I'm trying to create a virtual environment using pipenv. When I give the command pipenv install, I get the following error
I am using pipenv==2018.6.25
Traceback (most recent call last): File "c:\programdata\anaconda3\lib\site-packages\pipenv\vendor\requirementslib_compat.py", line 33, in do_import _tmp = importlib.import_module(internal) File "c:\programdata\anaconda3\lib\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:
Traceback (most recent call last): File "c:\programdata\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\programdata\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\Scripts\pipenv.exe__main__.py", line 5, in File "c:\programdata\anaconda3\lib\site-packages\pipenv__init__.py", line 23, in from .cli import cli File "c:\programdata\anaconda3\lib\site-packages\pipenv\cli.py", line 26, in from .utils import is_valid_url File "c:\programdata\anaconda3\lib\site-packages\pipenv\utils.py", line 59, in from .vendor.requirementslib import Requirement File "c:\programdata\anaconda3\lib\site-packages\pipenv\vendor\requirementslib__init__.py", line 6, in from .models import Requirement, Lockfile, Pipfile File "c:\programdata\anaconda3\lib\site-packages\pipenv\vendor\requirementslib\models__init__.py", line 8, in from .requirements import Requirement File "c:\programdata\anaconda3\lib\site-packages\pipenv\vendor\requirementslib\models\requirements.py", line 15, in from .markers import PipenvMarkers File "c:\programdata\anaconda3\lib\site-packages\pipenv\vendor\requirementslib\models\markers.py", line 6, in from .utils import validate_markers, filter_none File "c:\programdata\anaconda3\lib\site-packages\pipenv\vendor\requirementslib\models\utils.py", line 9, in from .._compat import Link File "c:\programdata\anaconda3\lib\site-packages\pipenv\vendor\requirementslib_compat.py", line 55, in Command = do_import("basecommand", "Command") File "c:\programdata\anaconda3\lib\site-packages\pipenv\vendor\requirementslib_compat.py", line 35, in do_import _tmp = importlib.import_module(pip9) File "c:\programdata\anaconda3\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named 'pip.basecommand'
Anybody has any idea how I can correct this error?
I just ran into a similar error during pipenv lock
.
After updating pipenv via pip install --user --upgrade pipenv
and pip via python -m pip install --upgrade pip
the lock command resulted in an error message rather than the traceback.
This error message stated:
There are incompatible versions in the resolved dependencies.
You may want to upgrade pipenv to the latest version. I had the same issue, now I installed version 2018.11.26, pipenv lock
works flawlessly.
pip install pipenv --upgrade
, this will install the latest pipenv. If there's permission error use sudo as a prefix or add --user parameter.source ~/.bashrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With