使用Debian 4.14.34-v7+上的Raspberry Pi,我试图用Python 3.6.5作为默认版本来设置pipenv
。我首先通过在Pi上编译它(需要几个小时...)安装Python3.6。在创建一个名为“robot”的目录后,我使用sudo pip3 install pipenv
和pipenv install --three
安装pipenv
。
然后我启动shell并打开Python,得到的是Python 3.5.3…
pi@raspberrypi:~/robot $ pipenv shell
Spawning environment shell (/bin/bash). Use 'exit' to leave.
. /home/pi/.local/share/virtualenvs/robot-XZ3Md9g0/bin/activate
pi@raspberrypi:~/robot $ . /home/pi/.local/share/virtualenvs/robot-XZ3Md9g0/bin/activate
(robot-XZ3Md9g0) pi@raspberrypi:~/robot $ python
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
我使用pipenv --python 3.6
切换了虚拟环境,但是尽管它正确(表面上)安装了,但我立即收到警告,指出pipenv仍然期望Python 3.5…
(robot-XZ3Md9g0) pi@raspberrypi:~/robot $ pipenv --python 3.6
Virtualenv already exists!
Remove existing virtualenv? [Y/n]: y
Removing existing virtualenv…
Creating a virtualenv for this project…
Using /usr/local/bin/python3.6m (3.6.5) to create virtualenv…
⠋Running virtualenv with interpreter /usr/local/bin/python3.6m
Using base prefix '/usr/local'
New python executable in /home/pi/.local/share/virtualenvs/robot-XZ3Md9g0/bin/python3.6m
Also creating executable in /home/pi/.local/share/virtualenvs/robot-XZ3Md9g0/bin/python
Installing setuptools, pip, wheel...done.
Virtualenv location: /home/pi/.local/share/virtualenvs/robot-XZ3Md9g0
Warning: Your Pipfile requires python_version 3.5, but you are using 3.6.5 (/home/pi/.local/share/v/r/bin/python).
$ pipenv check will surely fail.
(robot-XZ3Md9g0) pi@raspberrypi:~/robot $ python
Python 3.6.5 (default, May 3 2018, 11:25:17)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
当我第一次创建虚拟环境时,如何设置pipenv
以寻找Python 3.6?我可以手动编辑Pipfile,但这似乎有违让pipenv
为我处理事情的目的。
Your Pipfile requires python_version 3.5, but you are using X (...) pipenv check will surely fail.
- Tomasz Gandor