question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Release 1.0.11 broken on python3 with virtualenv

See original GitHub issue

I’m not sure of the exact scope of the breakage, but I have found prompt_toolkit to be reliably non-importable in a clean Python >= 3.5 virtualenv on a vanilla system. The affected version is 1.0.11; 1.0.10 works as expected.

plucas@plucas-vm:~$ virtualenv --python python3 venv
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/plucas/venv/bin/python3
Also creating executable in /home/plucas/venv/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
plucas@plucas-vm:~$ venv/bin/pip install prompt-toolkit==1.0.11
Collecting prompt-toolkit==1.0.11
  Using cached prompt_toolkit-1.0.11-py3-none-any.whl
Requirement already satisfied: six>=1.9.0 in ./venv/lib/python3.5/site-packages (from prompt-toolkit==1.0.11)
Collecting wcwidth (from prompt-toolkit==1.0.11)
  Using cached wcwidth-0.1.7-py2.py3-none-any.whl
Installing collected packages: wcwidth, prompt-toolkit
Successfully installed prompt-toolkit-1.0.11 wcwidth-0.1.7
plucas@plucas-vm:~$ venv/bin/python -c "import prompt_toolkit"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/plucas/venv/lib/python3.5/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/home/plucas/venv/lib/python3.5/site-packages/prompt_toolkit/interface.py", line 27, in <module>
    from .input import StdinInput, Input
ImportError: cannot import name 'StdinInput'
plucas@plucas-vm:~$ venv/bin/pip install prompt-toolkit==1.0.10
Collecting prompt-toolkit==1.0.10
  Using cached prompt_toolkit-1.0.10-py3-none-any.whl
Requirement already satisfied: wcwidth in ./venv/lib/python3.5/site-packages (from prompt-toolkit==1.0.10)
Requirement already satisfied: six>=1.9.0 in ./venv/lib/python3.5/site-packages (from prompt-toolkit==1.0.10)
Installing collected packages: prompt-toolkit
  Found existing installation: prompt-toolkit 1.0.11
    Uninstalling prompt-toolkit-1.0.11:
      Successfully uninstalled prompt-toolkit-1.0.11
Successfully installed prompt-toolkit-1.0.10
plucas@plucas-vm:~$ venv/bin/python -c "import prompt_toolkit"
plucas@plucas-vm:~$ echo $?
0

Python 2 is unaffected:

plucas@plucas-vm:~$ virtualenv --python python2 venv
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/plucas/venv/bin/python2
Also creating executable in /home/plucas/venv/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
plucas@plucas-vm:~$ venv/bin/pip install prompt-toolkit==1.0.11
Collecting prompt-toolkit==1.0.11
  Downloading prompt_toolkit-1.0.11-py2-none-any.whl (248kB)
    100% |████████████████████████████████| 256kB 3.3MB/s 
Requirement already satisfied: six>=1.9.0 in ./venv/lib/python2.7/site-packages (from prompt-toolkit==1.0.11)
Collecting wcwidth (from prompt-toolkit==1.0.11)
  Using cached wcwidth-0.1.7-py2.py3-none-any.whl
Installing collected packages: wcwidth, prompt-toolkit
Successfully installed prompt-toolkit-1.0.11 wcwidth-0.1.7
plucas@plucas-vm:~$ venv/bin/python -c "import prompt_toolkit"
plucas@plucas-vm:~$ echo $?
0

I have not tested whether this affects Python 3 outside of a virtualenv, but I would assume it is likely.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jonathanslenderscommented, Feb 2, 2017

Ok, great. I took me three tries before I got the build right. That’s why we’re jumping from 1.0.10 to 1.0.13. Thanks a lot for reporting.

0reactions
patricklucascommented, Feb 2, 2017

Thanks for the quick resolution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Broken with Python 3 and Ubuntu 18.04 #2922 - pypa/pipenv
Running the latest version of Python 3 and Ubuntu 18.04, I was getting the following error: pipenv --python 3 Creating a virtualenv for...
Read more >
Consequences for virtual env when system's Python is ...
Bad news: You're using venv , and venv virtual environments are not completely standalone. Even when created with --copies , all it copies ......
Read more >
12. Virtual Environments and Packages — Python 3.11.1 ...
The solution for this problem is to create a virtual environment, a self-contained directory tree that contains a Python installation for a particular...
Read more >
Release History — virtualenv 16.7.11 documentation
fix to support for Python 3 on MacOS 10.15 provided by Xcode (#1402) ... Don't install pre-release versions of pip, setuptools, or wheel...
Read more >
How to Set Up a Virtual Environment in Python – And Why It's ...
pip install virtualenv ; python<version> -m venv <virtual-environment-name> ; mkdir projectA cd projectA python3.8 -m venv env ; source env/bin/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found