安装virtualenv时出错

来源:3-10 python3基本讲解 和 linux 安装Python3

慕神8542595

2021-03-26

求救老师。
pip3 install virtualenv
Collecting virtualenv
Downloading https://files.pythonhosted.org/packages/91/fb/ca6c071f4231e06a9f0c3bd81c15c233bbacd4a7d9dbb7438d95fece8a1e/virtualenv-20.4.3-py2.py3-none-any.whl (7.2MB)
100% |████████████████████████████████| 7.2MB 6.3kB/s
Collecting six<2,>=1.9.0 (from virtualenv)
Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting importlib-metadata>=0.12 (from virtualenv)
Downloading https://files.pythonhosted.org/packages/80/5d/0bbca82b16e01313cf0343167d4cfb90f6fade747cd4d10d368094b2883a/importlib_metadata-3.7.3-py3-none-any.whl
Collecting importlib-resources>=1.0 (from virtualenv)
Downloading https://files.pythonhosted.org/packages/f0/5e/69e6a0602c1f18d390952177de648468c4a380252858b0022affc3ce7811/importlib_resources-5.1.2-py3-none-any.whl
Collecting filelock<4,>=3.0.0 (from virtualenv)
Downloading https://files.pythonhosted.org/packages/93/83/71a2ee6158bb9f39a90c0dea1637f81d5eef866e188e1971a1b1ab01a35a/filelock-3.0.12-py3-none-any.whl
Collecting appdirs<2,>=1.4.3 (from virtualenv)
Downloading https://files.pythonhosted.org/packages/3b/00/2344469e2084fb287c2e0b57b72910309874c3245463acd6cf5e3db69324/appdirs-1.4.4-py2.py3-none-any.whl
Collecting distlib<1,>=0.3.1 (from virtualenv)
Downloading https://files.pythonhosted.org/packages/f5/0a/490fa011d699bb5a5f3a0cf57de82237f52a6db9d40f33c53b2736c9a1f9/distlib-0.3.1-py2.py3-none-any.whl (335kB)
100% |████████████████████████████████| 339kB 20kB/s
Collecting typing-extensions>=3.6.4 (from importlib-metadata>=0.12->virtualenv)
Downloading https://files.pythonhosted.org/packages/60/7a/e881b5abb54db0e6e671ab088d079c57ce54e8a01a3ca443f561ccadb37e/typing_extensions-3.7.4.3-py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata>=0.12->virtualenv)
Downloading https://files.pythonhosted.org/packages/0f/8c/715c54e9e34c0c4820f616a913a7de3337d0cd79074dd1bed4dd840f16ae/zipp-3.4.1-py3-none-any.whl
Installing collected packages: six, typing-extensions, zipp, importlib-metadata, importlib-resources, filelock, appdirs, distlib, virtualenv
Successfully installed appdirs-1.4.4 distlib-0.3.1 filelock-3.0.12 importlib-metadata-3.7.3 importlib-resources-5.1.2 six-1.15.0 typing-extensions-3.7.4.3 virtualenv-20.4.3 zipp-3.4.1
You are using pip version 7.1.2, however version 21.0.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
此命令也出错
ln -s /usr/local/python3/bin/virtualenv /usr/bin/virtualenv
virtualenv -p /usr/bin/python3
Traceback (most recent call last):
File “/usr/bin/virtualenv”, line 7, in
from virtualenv.main import run_with_catch
File “/usr/local/python3/lib/python3.5/site-packages/virtualenv/init.py”, line 3, in
from .run import cli_run, session_via_cli
File “/usr/local/python3/lib/python3.5/site-packages/virtualenv/run/init.py”, line 13, in
from .plugin.activators import ActivationSelector
File “/usr/local/python3/lib/python3.5/site-packages/virtualenv/run/plugin/activators.py”, line 6, in
from .base import ComponentBuilder
File “/usr/local/python3/lib/python3.5/site-packages/virtualenv/run/plugin/base.py”, line 9, in
from importlib_metadata import entry_points
File “/usr/local/python3/lib/python3.5/site-packages/importlib_metadata/init.py”, line 92
dist: Optional[‘Distribution’] = None
^
SyntaxError: invalid syntax

写回答

1回答

编程浪子

2021-03-27

你好

没有记错的话 这个是不是还要指定文件夹

例如 virtualenv -p /usr/bin/python3 imooc 这样

非常抱歉,最近太忙了。回复晚了

0
0

Python Flask构建微信小程序订餐系统(可用于毕设)

微信小程序 + Python Flask 打造订餐系统全栈应用,可用于毕设。

1709 学习 · 1889 问题

查看课程