问题标签 [pip3]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
638 浏览

python - 无法使用 pip 安装 Python 包

我将创建自己的 Django Web 应用程序,但我无法准备虚拟环境并安装 Python 包。当我$ virtualenv在终端中执行时,出现错误:

$ pip命令结果如下:

$ pip3命令:

virtualenv, pip,pip3以 root 身份运行似乎可以正常工作。我正在做 Debian 9 测试。

谁能帮我?

0 投票
1 回答
652 浏览

python - 停止以 root 身份运行 pip 的 PyCharm

我需要在 PyCharm 中创建 Django 项目。我正在使用解释器3.6.3 at /usr/bin/python3.6。创建它后,我收到了 message Authentication is needed to run /usr/bin/python3.6 as the superuser。我点击了取消,我得到了:

但是,如果我提供密码并单击 Authenticate,则 pip、pip3 和 virtualenv 将被破坏,因为 IDE 正在尝试以 root 身份安装 Django。如何停止 PyCharm 以 root 身份运行 pip?

0 投票
0 回答
318 浏览

python - How to fix pip permissions after accidental `sudo pip install` usage

I know I shouldn't use sudo pip3 install, but while following a Django tutorial, I inadvertently did. Prior to the that command, pip3 defaulted to --user. Afterwards, I have to explicitly type it out. How do I revert back to having --user by default?

0 投票
1 回答
838 浏览

python - 尝试在 Windows 10 上安装 Python virtualenv。

收到错误。我已经让 Python 3.6.3 正常运行,并且在我的脚本目录中看到了 pip、pip3 和 pip3.6。我输入“C>\pip3 install virtualenv”,它开始,“收集virutalenv ...安装收集的包”,然后是“PermissionError:[Errno 13] Permission denied...我错过了什么?

0 投票
1 回答
174 浏览

python - Django 找不到 pip3 安装的模块

我创建了一个 Python 模块并使用 pip3 安装它。如果我检查 dist-package 文件夹,它就在那里。如果我将此模块导入一个新的 Python 项目,则可以。问题:我想在我的 Django 项目中使用这个模块,但是当我尝试导入它时找不到它。

已经尝试过:如果我将模块复制到站点包,它可以工作,但我不明白为什么我必须这样做。我希望这个与 pip3 一起安装的 Python 模块对每个人都可见,而无需从 dist 文件夹中复制/粘贴。

0 投票
1 回答
693 浏览

python - 在 Fedora 26 上使用 virtualenv venv 时出错

我在 Fedora 26 上使用pip3 install --user virtualenv.
系统有 python 2.7 和 python 3.6。
当我创建一个“virtualenv venv”时,我得到了这个输出和错误。

/home/asraisingh/venv/bin/python2 中的新 python 可执行文件还在 /home
/asraisingh/venv/bin/python 中创建可执行文件
安装 setuptools、pip、wheel...
命令 /home/asraisingh/venv/bin/ 的完整输出python2 - setuptools pip wheel:
回溯(最近一次调用最后):
文件“”,第7行,
文件“/home/asraisingh/.local/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1- py2.py3-none-any.whl/pip/ init .py”,第 7 行,
文件“/usr/lib64/python2.7/optparse.py”,第 77 行,
导入 textwrap
文件“/usr/lib64/ python2.7/textwrap.py”,第 10 行,在
导入字符串中,重新

文件“string.py”,第 1 行 KDE:9
^
SyntaxError: invalid syntax
----------------------------------------------------
...正在安装 setuptools,点子,轮子……完成了。
回溯(最后一次调用):
文件“/home/asraisingh/.local/bin/virtualenv”,第 11 行,在
sys.exit(main())
文件“/home/asraisingh/.local/lib/python2.7 /site-packages/virtualenv.py”,第 713 行,在主
symlink=options.symlink)
文件“/home/asraisingh/.local/lib/python2.7/site-packages/virtualenv.py”,第 945 行,在create_environment
下载=下载,
文件“/home/asraisingh/.local/lib/python2.7/site-packages/virtualenv.py”,第 901 行,在 install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT )
文件“/home/asraisingh/.local/lib/python2.7/site-packages/virtualenv.py”,第 797 行,在 call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/asraisingh/venv/bin /python2 - setuptools pip wheel 失败,错误代码为 1

0 投票
1 回答
1307 浏览

mysql - 命令“python setup.py egg_info”在 /tmp/pip-build-1qgj63ha/mysqlclient/ 中失败,错误代码为 1

在 CentOS7.2 中,我通过 pip3 安装 mysql 客户端,但得到以下错误:

众所周知,Python3 的 mysqlclient 是 Python2 的 MySQL-python 的替代品。但是为什么在CentOS7.2我不能安装呢?

0 投票
1 回答
1413 浏览

python-3.x - 为什么我的 Cygwin 设置告诉我没有安装 Python3.6?

Python 3.6 已安装(使用 Cygwin 安装程序 .exe 文件、更新等)。可执行文件位于/bin/...还是位于/usr/bin/?Cygwinls命令显示/usr/bin存在...但在 Windows 上此目录不存在。两个目录的内容也是相同的,包括如果我更改文件名......但我还没有找到一个符号链接(in/usr或 in /)来解释这一点!

我正在努力安装 virtualenvwrapper(这是与一本书一起编写的准备工作的一部分,TDD With Python)。

我刚刚克服了第一个障碍(最终),意识到我必须使用 pip3 安装 virtualenvwrapper,而不是 pip!......我觉得我在最深处。

所以我做了:

......然后我做了

(注意“python3”是指向 Python3 可执行文件的符号链接的正确名称/bin/;有一个“python”符号链接但指向 Python2.7)

我得到了:

未安装请求的 Python 版本 (3.6)
使用基本前缀 '/usr' 在 /home/Chris/.virtualenvs/superlists/bin/python3 中创建
新的 python 可执行文件还在 /home/Chris/.virtualenvs/superlists/bin/python 中创建
可执行文件
setuptools、pip、wheel...完成。
virtualenvwrapper.user_scripts 创建 /home/Chris/.virtualenvs/superlists/bin/predeactivate
virtualenvwrapper.user_scripts 创建 /home/Chris/.virtualenvs/superlists/bin/postdeactivate
virtualenvwrapper.user_scripts 创建 /home/Chris/.virtualenvs/superlists/bin/预激活
virtualenvwrapper.user_scripts 创建 /home/Chris/.virtualenvs/superlists/bin/postactivate
virtualenvwrapper.user_scripts 创建 /home/Chris/.virtualenvs/superlists/bin/get_env_details
(superlists)

有谁知道发生了什么?如何让系统识别实际安装了 Python3.6?

稍后或者......我是不是很密集?也许使用这个模块创建一个虚拟环境总是需要安装一个新的 Python 可执行文件?

后来我仍然不清楚这一点......但这并没有阻止我使用这本书virtualenv并且virtualenvwrapper通常继续阅读这本书。尽管抱怨 Python 不存在,但设置似乎(据我所知!)使用目录 .virtualenv/ 目录下的符号链接到 /bin/ 中的 Python 符号链接之一...

0 投票
2 回答
8031 浏览

python - No module named rest_framework

i've seen a lot of people having trouble with this here, and i always see them saying other to use pip3 or just pip to install it.

But in my case i've uninstalled it and installed id multiple times both using pip or pip3 and none of them seem to work.

I've added 'rest_framework' to my settings as well and still doesn't seem to work. Help me out please

Collecting djangorestframework Downloading djangorestframework-3.7.3-py2.py3-none-any.whl (1.5MB) 100% |████████████████████████████████| 1.5MB 506kB/s Installing collected packages: djangorestframework Successfully installed djangorestframework-3.7.3

Still not working

EDIT 2

0 投票
1 回答
445 浏览

python - 无法在 cygwin 上运行 pip3

我不能在 venv 中使用 pip3(在 cygwin 上),但是为什么呢?
我也许可以在 venv 之外使用它。