You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pip 18.1 causes "TypeError: 'module' object is not callable" #2924
Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.
Check the diagnose documentation for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.
Make sure to mention your debugging experience if the documented solution failed.
Issue description
New version of pip breaks pipenv, exactly on this line
...
File "/opt/myproj/.tox/py36/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 704, in from_line
line, extras = _strip_extras(line)
TypeError: 'module' object is not callable
Steps to replicate
Provide the steps to replicate (which usually at least includes the commands and the Pipfile).
Please run $ pipenv --support, and paste the results here. Don't put backticks (`) around it! The output already contains Markdown formatting.
If you're on macOS, run the following:
$ pipenv --support | pbcopy
If you're on Windows, run the following:
> pipenv --support | clip
If you're on Linux, run the following:
$ pipenv --support | xclip
Reacted by David Neale, Marek Skalický, João Santos, Chris Vaughn, Floris Lambrechts, Tanner Rollefson, Michael Barney, Jr, Andrey Vlasovskikh, Julien Muniak, Timost and 64 more
This is extremely aggravating. Can you please try to coordinate releases of pip and pipenv?
Reacted by Ed Sweeney, Konstantin Kochin, György Kiss, Amir Raminfar, Aaron Sewall, Brandon Catubig, Lewis Dexter Litanzios, Gary Metzker, Corey Cole, Owais Lone and 30 more
Reacted by Jamie Thomson, Javier Moreno, Tom Pansino, Owais Lone, Hans-Kristian Koren, Liz Balbuena, Eric Arellano, Aaron Bach, Josh Smeaton, Andriano Winatra and 13 more
pip install pipenv
pipenv run pip install pip==18.0
pipenv install
Reacted by Thorin Schiffer, Thibaud Martinez, Christian Stefanescu, Honza Benes, Dave Yeager, JerzySpendel, Ruben Laguna, Kevin Pauli, Dmitry Krylov, Vincent Ahrend and 155 more
Reacted by Boris, Jenuhveeev, Vladislav, reiot, Shawn X, Abdulhaq Emhemmed, pfdiy, Daniel Karlsson, hatu035, Ilya Baryshnikov and 7 more
Reacted by Asher Foa, David Nikel-Shepherd, Baraka, JKatzwinkel, Saqib Ameen and Stephen Akinyemi
Reacted by Ronnie Dove, Boris, Jenuhveeev, Napoleon Ahiable, Shawn X, Tanay Chowdhury, Abdulhaq Emhemmed, pfdiy, Akshay S Dinesh, Thierry Chappuis and 12 more
@Froskekongen Please try to avoid non-constructive messages. We understand this is frustrating, but interrogation doesn’t help. If you feel we need to improve, consider offering help instead of shouting at the sideline. “We” (whoever you are referring to) are always short of resources, and would gladly use your help.
Reacted by David Neale, Christian Stefanescu, René, PERIN François, Yassine Ameur, Ron Hockman, Konstantin Kochin, Ben Rometsch, Boris, Ilaï Deutel and 81 more
Reacted by György Kiss
Reacted by Christian Stefanescu, Chris Vaughn, Kevin Pauli, Rafael Carício, PERIN François, Charles-Axel Dein, Ron Hockman, Boris, Brandon Catubig, Gurkenkönig and 36 more
I'm seeing this issue as well. @nealedj 's suggestion worked correctly, although if you're working around this in a build environment that already has pipenv installed, you don't need to re-install pipenv. Only lines 2 and 3 of his workaround are needed.
Reacted by Peter Nicks, Yassine Ameur and Napoleon Ahiable
File "/usr/local/lib/python3.6/dist-packages/pipenv/vendor/requirementslib/_compat.py", line 33, in do_import
_tmp = importlib.import_module(internal)
File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pip._internal.basecommand'
During handling of the above exception, another exception occurred
$ tox --recreate
GLOB sdist-make: D:\workspace\development\python\pytest\mysite\setup.py
pipenv_test create: D:\workspace\development\python\pytest\mysite\.tox\pipenv_test
pipenv_test installdeps: pipenv
pipenv_test inst: D:\workspace\development\python\pytest\mysite\.tox\dist\mysite-0.1.zip
pipenv_test installed: certifi==2018.8.24,mysite==0.1,pipenv==2018.7.1,virtualenv==16.0.0,virtualenv-clone==0.3.0
pipenv_test run-test-pre: PYTHONHASHSEED='272'
pipenv_test runtests: commands[0] | pipenv install --dev
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead.
Pipfile.lock (e7cb29) out of date, updating to (75f29b)...
Locking [dev-packages] dependencies...
ython\pytest\mysite\.tox\pipenv_test\lib\site-packages\pipenv\utils.py", line 402, in resolve_deps
req_dir=req_dir
File "d:\workspace\development\python\pytest\mysite\.tox\pipenv_test\lib\site-packages\pipenv\utils.py", line 250, in actually_resolve_deps
req = Requirement.from_line(dep)
File "d:\workspace\development\python\pytest\mysite\.tox\pipenv_test\lib\site-packages\pipenv\vendor\requirementslib\models\requirements.py", line 704, in from_line
line, extras = _strip_extras(line)
TypeError: 'module' object is not callable
ERROR: InvocationError for command 'D:\\workspace\\development\\python\\pytest\\mysite\\.tox\\pipenv_test\\Scripts\\pipenv.EXE install --dev' (exited with code 1)
___________________________________ summary ___________________________________
ERROR: pipenv_test: commands failed
I just installed pipenv around 5 hours ago. I fixed a lot of errors both hardware and software , in the past 24 hours to get my laptop working to get there. After skimming this thread for the I found the first workaround #2924 (comment) but it had a dozen 😆 emojis so I thought maybe this guy is having a joke. Just incase he wasn't lying I needed to corroborate his claims. I could have asked for help then as well. But no, I googled. And I found this, https://stackoverflow.com/a/52706841 where the author states You need to downgrade pip — both inside and outside the pipenv environment — to version 18.0 in order for pipenv to work. with 9 upvotes.
So I downgraded to pip v18.0.0 and when I still had the same errors I posted here. And once I had posted I found others with pip/pipenv errors with pip v18.0 (18 instances of 18.0 on this page excluding this comment.)
All I wanted was some help. Yes, I could have read through every one of the 100+ comments/references here before asking for help and I guess that is a mistake.
Over the years, I have learnt that I shouldn't use/apply any unknown command without knowing what it does. What if a command(s) given in this thread broke my python setup the odd way? Should I use the dirty workaround and not recommended workaround given somewhere in the thread? What if my python installation resembled this https://xkcd.com/1987/ due to the usage of unknown commands?
Looking at the first comment I see it has sections Issue description, Expected result, Actual result, Steps to replicate and also a part which asks for others' help with pipenv --support | xclip, which are all, I assume to be a part of a template for reporting new issues. Could it be so difficult to have a stickied comment saying Current Workarounds (which could only be edited by mods here), which listed pip versions against the current known workarounds for that issue?
I suggest actually reading the thread. The workaround is posted quiet early in the discussion, and is confirmed to work by multiple people.
Instead of taking that two-sentence potshot at me, you could have just given me a link and tagged me. You assumed I was lazy, not working on my problem and worse yet, you knew exactly which comment would have helped me and instead of linking me to it, you actively chose to make me look for it. What is the reason for this animosity?
Please try to avoid non-constructive messages. We understand this is frustrating, but interrogation doesn't help. If you feel we need to improve, consider offering help instead of shouting at the sideline. "We" (whoever you are referring to) are always short of resources, and would gladly use your help.
So many programmers say "Never be afraid to ask a question..... after you have researched or worked on it a bit" but what can a person do when the admins of a project are so fervent in their hatred for just someone asking a question. Anyone asking questions should just curl up and die, right?
I tried and I am just tired and I haven't felt this low in weeks. I will avoid participating in this thread any further.
Also you can upgrade pipenv to the latest version. If you have further problems please open a new issue. I’m going to lock this thread for now to prevent continued discussion as this is resolved.
To summarize for people on earlier releases than 2018.10.9: you can pin pip inside the virtualenv using pipenv run python -m pip install pip==18.0 or you can set the environment variable PIP_SHIMS_BASE_MODULE=pipenv.patched.notpip
Others should not be seeing this issue. Thanks for your patience all and apologies for the issues!
One follow up: @Ativerc I am sorry for your negative experience. We are a two person team triaging literally thousands of issues, so we tend to get a bit frustrated when there are solutions posted and it seems like we are just answering a repeat of the original question. We aren’t always that organized with information and we definitely can improve there, but I genuinely apologize for leaving you feeling a bit deflated here. We are likely going to try to add some folks if possible to help out with this
Activity
uranusjr commentedon Oct 5, 2018
Tracked in upstream repo (referenced above).
uranusjr commentedon Oct 5, 2018
On second thought, I’m going to keep this open so people don’t open duplicates.
[-]New version of pip (18.1) breaks pipenv[/-][+]pip 18.1 causes "TypeError: 'module' object is not callable"[/+]Pin pip version to work around an issue in pipenv.
nikovitto commentedon Oct 5, 2018
Same problem here. See attach log.
pipenverror.log
mbarneyjr commentedon Oct 5, 2018
Same problem here
$ pipenv --support
Pipenv version:
'2018.7.1'Pipenv location:
'/Users/mbarney/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pipenv'Python location:
'/Users/mbarney/.pyenv/versions/3.6.6/bin/python3.6'Other Python installations in
PATH:2.7:/usr/bin/python2.72.7:/Users/mbarney/.pyenv/shims/python2.72.7:/Users/mbarney/.pyenv/shims/python2.72.7:/usr/bin/python2.72.7:/Users/mbarney/.pyenv/shims/python2.73.6:/Users/mbarney/.pyenv/versions/3.6.6/bin/python3.6m3.6:/Users/mbarney/.pyenv/versions/3.6.6/bin/python3.63.6:/Users/mbarney/.pyenv/shims/python3.63.6:/Users/mbarney/.pyenv/shims/python3.63.6:/Users/mbarney/.pyenv/shims/python3.63.6.6:/Users/mbarney/.pyenv/versions/3.6.6/bin/python3.6.6:/Users/mbarney/.pyenv/shims/python3.6.6:/Users/mbarney/.pyenv/shims/python2.7.10:/usr/bin/python3.6.6:/Users/mbarney/.pyenv/shims/pythonNone:/Users/mbarney/.pyenv/shims/python2None:/Users/mbarney/.pyenv/shims/python2None:/Users/mbarney/.pyenv/shims/python23.6.6:/Users/mbarney/.pyenv/versions/3.6.6/bin/python33.6.6:/Users/mbarney/.pyenv/shims/python33.6.6:/Users/mbarney/.pyenv/shims/python33.6.6:/Users/mbarney/.pyenv/shims/python3PEP 508 Information:
System environment variables:
TERM_PROGRAMPYENV_ROOTNVM_CD_FLAGSTERMSHELLTMPDIRApple_PubSub_Socket_RenderTERM_PROGRAM_VERSIONTERM_SESSION_IDPYENV_VERSIONUSERNVM_DIRSSH_AUTH_SOCKPYENV_DIR__CF_USER_TEXT_ENCODINGPATHPWDLANGPYENV_HOOK_PATHXPC_FLAGSXPC_SERVICE_NAMEHOMESHLVLPYENV_SHELLLOGNAMENVM_BINPYTHONDONTWRITEBYTECODEPIP_PYTHON_PATHPipenv–specific environment variables:
Debug–specific environment variables:
PATH:/Users/mbarney/.pyenv/versions/3.6.6/bin:/usr/local/Cellar/pyenv/1.2.7/libexec:/Users/mbarney/.pyenv/shims:/Users/mbarney/.pyenv/shims:/Users/mbarney/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/mbarney/.pyenv/shims:/Users/mbarney/.pyenv/bin:/Users/mbarney/.nvm/versions/node/v8.11.4/binSHELL:/bin/bashLANG:en_US.UTF-8PWD:/Users/mbarney/dev/trek10/github/awsume/sourceContents of
Pipfile('/Users/mbarney/dev/trek10/github/awsume/source/Pipfile'):Froskekongen commentedon Oct 5, 2018
This is extremely aggravating. Can you please try to coordinate releases of
pipandpipenv?Pin pip version to work around an issue in pipenv.
nealedj commentedon Oct 5, 2018
Workaround for typical virtualenv setup:
techalchemy commentedon Oct 5, 2018
Hmm is this actually moved?
uranusjr commentedon Oct 5, 2018
@Froskekongen Please try to avoid non-constructive messages. We understand this is frustrating, but interrogation doesn’t help. If you feel we need to improve, consider offering help instead of shouting at the sideline. “We” (whoever you are referring to) are always short of resources, and would gladly use your help.
pfwnicks commentedon Oct 5, 2018
same issue here but only for new pipenv environments, installs still work on the old ones as I have not updated to the newest pip in there.
@nealedj suggestion worked
#2924 (comment)
allen-fisher-spok commentedon Oct 5, 2018
I'm seeing this issue as well. @nealedj 's suggestion worked correctly, although if you're working around this in a build environment that already has pipenv installed, you don't need to re-install pipenv. Only lines 2 and 3 of his workaround are needed.
66 remaining items
force pip version to 18.0 -
Temporary hack around pip/pipenv clash
BeyondEvil commentedon Oct 9, 2018
Workaround doesn't work for me.
I'm using pipenv in a docker image.
Here's what the RUN target looks like with the workaround:
What I believe to be the problem are these lines:
andrii-rubtsov commentedon Oct 10, 2018
@BeyondEvil Try
RUN pip install pip==18.0beforeRUN pip install.jayprakashdutta commentedon Oct 10, 2018
File "/usr/local/lib/python3.6/dist-packages/pipenv/vendor/requirementslib/_compat.py", line 33, in do_import
_tmp = importlib.import_module(internal)
File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pip._internal.basecommand'
During handling of the above exception, another exception occurred
Update pipenv to address incompatibility with pip 18.1
whg517 commentedon Oct 11, 2018
https://pipenv.readthedocs.io/en/latest/advanced/#tox-automation-project
I also ran into this problem when I used pipenv on tox as a reference. I just installed dependent packages and haven't started doing anything else yet
tox.ini
Is there any way to just solve it?
thanks
force pip version to 18.0 -
Ativerc commentedon Oct 13, 2018
I'm getting the same errors on python3.5 and pip v18.0.0. Any ideas what i can do now?
uranusjr commentedon Oct 13, 2018
I suggest actually reading the thread. The workaround is posted quite early in the discussion, and is confirmed to work by multiple people.
Ativerc commentedon Oct 13, 2018
I just installed pipenv around 5 hours ago. I fixed a lot of errors both hardware and software , in the past 24 hours to get my laptop working to get there. After skimming this thread for the I found the first workaround #2924 (comment) but it had a dozen 😆 emojis so I thought maybe this guy is having a joke. Just incase he wasn't lying I needed to corroborate his claims. I could have asked for help then as well. But no, I googled. And I found this, https://stackoverflow.com/a/52706841 where the author states
You need to downgrade pip — both inside and outside the pipenv environment — to version 18.0 in order for pipenv to work.with 9 upvotes.So I downgraded to pip v18.0.0 and when I still had the same errors I posted here. And once I had posted I found others with pip/pipenv errors with pip v18.0 (18 instances of
18.0on this page excluding this comment.)All I wanted was some help. Yes, I could have read through every one of the 100+ comments/references here before asking for help and I guess that is a mistake.
Over the years, I have learnt that I shouldn't use/apply any unknown command without knowing what it does. What if a command(s) given in this thread broke my python setup the odd way? Should I use the
dirty workaround and not recommendedworkaround given somewhere in the thread? What if my python installation resembled this https://xkcd.com/1987/ due to the usage of unknown commands?Looking at the first comment I see it has sections
Issue description,Expected result,Actual result,Steps to replicateand also a part which asks for others' help withpipenv --support | xclip, which are all, I assume to be a part of a template for reporting new issues. Could it be so difficult to have a stickied comment sayingCurrent Workarounds(which could only be edited by mods here), which listed pip versions against the current known workarounds for that issue?Instead of taking that two-sentence potshot at me, you could have just given me a link and tagged me. You assumed I was lazy, not working on my problem and worse yet, you knew exactly which comment would have helped me and instead of linking me to it, you actively chose to make me look for it. What is the reason for this animosity?
That's coming from a guy who wrote here: #2924 (comment)
So many programmers say "Never be afraid to ask a question..... after you have researched or worked on it a bit" but what can a person do when the admins of a project are so fervent in their hatred for just someone asking a question. Anyone asking questions should just curl up and die, right?
I tried and I am just tired and I haven't felt this low in weeks. I will avoid participating in this thread any further.
stefan-it commentedon Oct 13, 2018
@Ativerc If 18.0 does not work for you, please try the following:
#2924 (comment)
It then worked for me :)
techalchemy commentedon Oct 13, 2018
Also you can upgrade pipenv to the latest version. If you have further problems please open a new issue. I’m going to lock this thread for now to prevent continued discussion as this is resolved.
To summarize for people on earlier releases than
2018.10.9: you can pin pip inside the virtualenv usingpipenv run python -m pip install pip==18.0or you can set the environment variablePIP_SHIMS_BASE_MODULE=pipenv.patched.notpipOthers should not be seeing this issue. Thanks for your patience all and apologies for the issues!
techalchemy commentedon Oct 13, 2018
One follow up: @Ativerc I am sorry for your negative experience. We are a two person team triaging literally thousands of issues, so we tend to get a bit frustrated when there are solutions posted and it seems like we are just answering a repeat of the original question. We aren’t always that organized with information and we definitely can improve there, but I genuinely apologize for leaving you feeling a bit deflated here. We are likely going to try to add some folks if possible to help out with this