问题
I am working on a website with Django Heroku template. I want to work on this website on my Windows computer, and one of the requirements to work with Heroku and Python is to have pipenv (the project has a Pipfile).
To install pipenv on Windows, I have tried two commands in the cmd terminal, which gave approximately the same error:
pip install pipenv
results in
Collecting pipenv
Using cached pipenv-11.9.0.tar.gz
Complete output from command python setup.py egg_info:
error in pipenv setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in pathlib;python_version<"3.4" at ;python_version<"3.4"
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\myUserName\AppData\Local\Temp\pip-build-267yrlop\pipenv\
And:
easy_install -U pipenv
results in
Searching for pipenv
Reading https://pypi.python.org/simple/pipenv/
Best match: pipenv 11.9.0
Downloading https://pypi.python.org/packages/aa/43/e7426676c659fa3c1db28653ceee3571efbaaec2d2795bca00212989268a/pipenv-11.9.0.tar.gz#md5=0cdefd8434dc2b30415708d517730dcb
Processing pipenv-11.9.0.tar.gz
Writing C:\Users\myUserName\AppData\Local\Temp\easy_install-p2bvwljy\pipenv-11.9.0\setup.cfg
Running pipenv-11.9.0\setup.py -q bdist_egg --dist-dir C:\Users\myUserName\AppData\Local\Temp\easy_install-p2bvwljy\pipenv-11.9.0\egg-dist-tmp-vfore9pv
error: Setup script exited with error in pipenv setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in pathlib;python_version<"3.4" at ;python_version<"3.4"
I don't really understand the error message. It seems like an error in the setup script of pipenv but most likely isn't. Or is it expecting a Python version lower than 3.4? (if so, how do I install it with my Python 3.5?)
EDIT: I've tried with admin rights, in and out of a virtualenv, but same result.
回答1:
I think this has to do with an outdated version of either setuptools or pip. First try updating setuptools with
pip install --upgrade setuptools
and then installing pipenv with
pip install pipenv
If that still fails, try updating your version of pip with
pip install --upgrade pip
or (because you mentioned you were on Windows)
python -m pip install --upgrade pip
回答2:
got it from here
On Windows you can find the user base binary directory by running py -m site --user-site and replacing site-packages with Scripts. For example, this could return C:\Users\Username\AppData\Roaming\Python36\site-packages so you would need to set your PATH to include C:\Users\Username\AppData\Roaming\Python36\Scripts. You can set your user PATH permanently in the Control Panel. You may need to log out for the PATH changes to take effect.
i am not able to produce this is on machine, but if possible then go with anaconda it have many libraries pre-installed
来源:https://stackoverflow.com/questions/49740073/installation-of-pipenv-on-windows-fails