-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: No module named typing python 2 with pipenv #1176
Comments
I've been hit by exactly the same problem, but with python 3.4. A quick investigation suggests the problem comes from commit ac4a2d0. The code itself is correct, but my guess is that pypi wheels have precomputed dependencies, so this part of the code in setup.py does not run on the local machine, so it is not tested against the local version of python. Here's a test: $ virtualenv -p python3.4 toto Running virtualenv with interpreter /usr/bin/python3.4 Using base prefix '/usr' New python executable in /tmp/toto/bin/python3.4 Also creating executable in /tmp/toto/bin/python Installing setuptools, pkg_resources, pip, wheel...done. $ cd toto $ . bin/activate (toto) $ pip install django_extensions Collecting django_extensions Downloading django_extensions-2.0.2-py2.py3-none-any.whl (217kB) 100% |████████████████████████████████| 225kB 1.0MB/s Collecting six>=1.2 (from django_extensions) Using cached six-1.11.0-py2.py3-none-any.whl Installing collected packages: six, django-extensions Successfully installed django-extensions-2.0.2 six-1.11.0 (toto) $ python -V Python 3.4.4 (toto) $ python Python 3.4.4 (default, Feb 9 2016, 16:12:46) [GCC 5.3.1 20160205] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import typing Traceback (most recent call last): File "", line 1, in ImportError: No module named 'typing' So, yes, the django_extensions wheel is built for any python version (django_extensions-2.0.2-py2.py3-none-any.whl), it seems. I'm not an expert with python wheels and setup code, but could environment markers (https://www.python.org/dev/peps/pep-0496/) be an alternative? Now, until this gets resolved in django_extensions, I would advise adding the typing module to your project dependencies. |
Confirmed, getting build fails here. https://travis-ci.org/dokterbob/django-newsletter/builds/350810367?utm_source=github_status&utm_medium=notification |
Please test with Django Extensions 2.0.5 and hopefully that fixes the issues. |
@trbs I just tested it, it seems to solve the problem for me, thank you! |
awesome, please reopen if it turns out there are other edge cases. |
This reverts commit 2f7e707 as the django-extensions issue seems solved. Ref: django-extensions/django-extensions#1176 (comment)
This reverts commit 2f7e707 as the django-extensions issue seems solved. Ref: django-extensions/django-extensions#1176 (comment)
Pipenv still does not find typing on python 2 for me it seems it is the wrong use of the
For a optional install depending on the python version I would recommend this in the install_requires = [
'six>=1.2',
'typing;python_version<"3.5"',
] |
Thought there issues with people using older versions of What if we do:
So old versions of |
please test with master :-) |
Seems to work this way
|
released version 2.0.7 hopefully this is permanently fixed :-) |
For me, this had a root cause in pip upgrading to a version not actually allowed by Python when using pip install -U pip. I had to curl and install the latest python2 pip version using the commands below:
Then all of the usual pip installs worked as expected. But with pip v21, it would attempt to install versions of packages that were not python2 compatible. |
worked like a charm... thank you so much saved a hell a lot of time |
When installing latest version through pipenv on python 2 the typing dependency is skipped causing the importerror.
The text was updated successfully, but these errors were encountered: