前置条件:
切换到pipfile文件所在目录gotest_official
问题描述:
使用pipenv install创建虚拟环境,报错
wangju@wangju-HP-348-G4:~/Desktop/gotest_official$ pipenv install
Warning: Python 3.7 was not found on your system…
You can specify specific versions of Python with:
$ pipenv --python path/to/python
问题分析:
pipfile中记录的python版本与开发机器中存在的python版本不一致导致
解决过程:
whereis python3
wangju@wangju-HP-348-G4:~/Desktop/gotest_official$ pipenv --python /usr/bin/python3.6
Creating a virtualenv for this project…
Pipfile: /home/wangju/Desktop/gotest_official/Pipfile
Using /usr/bin/python3.6 (3.6.8) to create virtualenv…
? Creating virtual environment...Already using interpreter /usr/bin/python3.6
Using base prefix ‘/usr‘
New python executable in /home/wangju/.virtualenvs/gotest_official-ZTIMAEbX/bin/python3.6
Also creating executable in /home/wangju/.virtualenvs/gotest_official-ZTIMAEbX/bin/python
Installing setuptools, pip, wheel...
done.
Running virtualenv with interpreter /usr/bin/python3.6
? Successfully created virtual environment!
Virtualenv location: /home/wangju/.virtualenvs/gotest_official-ZTIMAEbX
Warning: Your Pipfile requires python_version 3.7, but you are using 3.6.8 (/home/wangju/./g/bin/python).
$ pipenv --rm and rebuilding the virtual environment may resolve the issue.
$ pipenv check will surely fail.
使用lsvirtualenv查看开发机虚拟环境列表,可以看到,gotest_official项目的虚拟环境已经创建成功了
[pipenv]Warning: Python 3.7 was not found on your system…
原文:https://www.cnblogs.com/kaerxifa/p/11875710.html