Python Poetry - 在虚拟环境中工作时遇到问题

时间:2021-02-22 01:36:47

标签: python python-venv python-packaging python-poetry

前几天我安装了 Poetry,一切顺利。我创建了一个项目,并且能够使用 Poetry 命令在 venv 内部执行操作。然后,我创建了一个新项目,只是为了尝试影响我当前(更重要)的项目。从那时起,我无法在任何新项目中使用 Poetry venv(诗歌外壳)做任何事情,但当我回到我的主项目时它仍然可以完美运行。我对此表示感谢,但想弄清楚发生了什么以备将来使用。下面是我在用 Poetry 创建的新目录的 venv 中尝试的一些事情。关于可能出现问题的任何想法。我什至卸载并重新安装它,并不断收到相同的错误。感谢您抽出宝贵时间。

The virtual environment found in /home/jesse/.cache/pypoetry/virtualenvs/demo-OhcC5qq9-py3.8 seems to be broken.
Recreating virtualenv demo-OhcC5qq9-py3.8 in /home/jesse/.cache/pypoetry/virtualenvs/demo-OhcC5qq9-py3.8

  FileNotFoundError

  [Errno 2] No such file or directory: '/home/jesse/.cache/pypoetry/virtualenvs/demo-OhcC5qq9-py3.8/bin/python3'

  at ~/.poetry/lib/poetry/_vendor/py3.8/virtualenv/discovery/builtin.py:61 in propose_interpreters
       57│ def propose_interpreters(spec, app_data):
       58│     # 1. if it's a path and exists
       59│     if spec.path is not None:
       60│         try:
    →  61│             os.lstat(spec.path)  # Windows Store Python does not work with os.path.exists, but does for os.lstat
       62│         except OSError:
       63│             if spec.is_abs:
       64│                 raise
       65│         else:
(demo-OhcC5qq9-py3.8) jesse@superuser:~/demo$ poetry add requests

  FileNotFoundError

  [Errno 2] No such file or directory: 'python'

  at /usr/lib/python3.8/subprocess.py:1702 in _execute_child
      1698│                     else:
      1699│                         err_filename = orig_executable
      1700│                     if errno_num != 0:
      1701│                         err_msg = os.strerror(errno_num)
    → 1702│                     raise child_exception_type(errno_num, err_msg, err_filename)
      1703│                 raise child_exception_type(err_msg)
      1704│
      1705│
      1706│         def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
'''

0 个答案:

没有答案
相关问题