0

我有两个空文件夹: foo 和 blaa

blaa 曾经是一个工作项目,直到它开始给我带来 pipenv 的痛苦——我系统地清空了它,更改了文件夹名称,但痛苦一直跟着我:

我在每个空文件夹中运行以下命令(注意:没有隐藏文件或目录)

pipenv install pytest

在 foo 我得到:

vagrant@vagrant:/code/foo$ pipenv install paho-mqtt
Creating a virtualenv for this project…
Using /usr/bin/python3 (3.8.10) to create virtualenv…
⠋created virtual environment CPython3.8.10.final.0-64 in 81ms
  creator CPython3Posix(dest=/home/vagrant/.local/share/virtualenvs/foo-AFutVnBW, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/vagrant/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

Virtualenv location: /home/vagrant/.local/share/virtualenvs/foo-AFutVnBW
Creating a Pipfile for this project…
Installing paho-mqtt…
Looking in indexes: https://pypi.python.org/simple
Collecting paho-mqtt
  Downloading paho-mqtt-1.5.1.tar.gz (101 kB)
Building wheels for collected packages: paho-mqtt
  Building wheel for paho-mqtt (setup.py): started
  Building wheel for paho-mqtt (setup.py): finished with status 'done'
  Created wheel for paho-mqtt: filename=paho_mqtt-1.5.1-py3-none-any.whl size=61543 sha256=f69aee3db388506bf64f80333fe134bf798a03db1498a985874fbbea195d615b
  Stored in directory: /home/vagrant/.cache/pip/wheels/78/ec/85/b657c03288b6e363c90369c96ee04eea9abb9be78cadb7855b
Successfully built paho-mqtt
Installing collected packages: paho-mqtt
Successfully installed paho-mqtt-1.5.1

Adding paho-mqtt to Pipfile's [packages]…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (04e2bd)!
Installing dependencies from Pipfile.lock (04e2bd)…
     ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:00
To activate this project's virtualenv, run the following:
 $ pipenv shell

在 blaa 我得到:

vagrant@vagrant:/code/blaa$ pipenv install pytest
Installing pytest…
⠹
Error:  An error occurred while installing pytest!
Traceback (most recent call last):
  File "/home/vagrant/.local/share/virtualenvs/blaa-AazdBo4I/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
  File "/home/vagrant/.local/share/virtualenvs/blaa-AazdBo4I/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/home/vagrant/.local/share/virtualenvs/blaa-AazdBo4I/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/home/vagrant/.local/share/virtualenvs/blaa-AazdBo4I/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/home/vagrant/.local/share/virtualenvs/blaa-AazdBo4I/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
    from pip._internal.exceptions import CommandError
  File "/home/vagrant/.local/share/virtualenvs/blaa-AazdBo4I/lib/python3.8/site-packages/pip/_internal/exceptions.py", line 10, in <module>
    from pip._vendor.six import iteritems
ModuleNotFoundError: No module named 'pip._vendor.six'

vagrant@vagrant:/code/blaa$ 

我尝试在 blaa 中运行以下命令来清理任何剩余的“东西”——但无济于事

vagrant@vagrant:/code/blaa$ pipenv --rm
Removing virtualenv (/home/vagrant/.local/share/virtualenvs/blaa-AazdBo4I)…
vagrant@vagrant:/code/blaa$ pipenv uninstall --all
Creating a virtualenv for this project…
Using /home/vagrant/.pyenv/versions/3.8.0/bin/python3.8 (3.8.0) to create virtualenv…
⠋created virtual environment CPython3.8.0.final.0-64 in 124ms
  creator CPython3Posix(dest=/home/vagrant/.local/share/virtualenvs/blaa-AazdBo4I, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/vagrant/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

Virtualenv location: /home/vagrant/.local/share/virtualenvs/blaa-AazdBo4I
Un-installing all packages from virtualenv…
Found 0 installed package(s), purging…

Environment now purged and fresh!
vagrant@vagrant:/code/blaa$ 

环境细节:

  1. pipenv,版本 11.9.0
  2. Python 3.8.0
  3. pyenv 2.0.6
  4. Ubuntu 20.04.2 LTS
  5. Linux vagrant 5.4.0-77-generic
4

0 回答 0