当我跑:
sudo pip install ipython
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
OSError:[Errno:1]不允许操作:'/System/Library/Frameworks/Python.framework/Versions/2.7/share'
执行的最后一个命令尝试创建上面给出的目录.
此外,以下命令无法在不提供任何错误的情况下安装iPython.
sudo pip install --user python
Run Code Online (Sandbox Code Playgroud)
(我在Mac OS X El Capitan上,以防此操作系统上的其他人看到同样的问题.)
在我的macOS Mojave终端中,我想用pip安装一个python包.它有效,但它说:
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Run Code Online (Sandbox Code Playgroud)
所以我想用给定的命令更新pip,但是我收到一个错误:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied:
'/Library/Python/2.7/site-packages/pip-18.0-py2.7.egg/EGG-INFO/PKG-INFO'
Consider using the `--user` option or check the permissions.
Run Code Online (Sandbox Code Playgroud)
这个东西可以滚动 - - - - - >
我真的不明白现在该做什么.此外,我意识到它在错误消息中说Python 2.7,但我有并且只想使用python 3.
我安装了所有依赖项的opencv.安装完成后,我尝试导入matplotlib作为一个简单的例子.
然后我得到以下错误,当我尝试通过pip安装matplotlib时pip install matplotlib:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/kiwisolver.cpython-35m-x86_64-linux-gnu.so'
Consider using the `--user` option or check the permissions.
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能安装matplotlib?
我不能在Ubuntu上安装基本的Django包.我刚刚删除了virtualenv并重新制作了它.pip3install=pip3 install -r requirements.txt
[mything] cchilders@cchilders-desktop:~/projects/mything (master)
$ cat requirements.txt
Django==1.10.1
django-filter
djangorestframework
psycopg2
twilio
ipdb
ipython
[mything] cchilders@cchilders-desktop:~/projects/mything (master)
$ pip3install
Collecting Django==1.10.1 (from -r requirements.txt (line 1))
Using cached Django-1.10.1-py2.py3-none-any.whl
Collecting django-filter (from -r requirements.txt (line 2))
Using cached django_filter-0.15.2-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): djangorestframework in /home/cchilders/.local/lib/python3.5/site-packages (from -r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): psycopg2 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 4))
Collecting twilio (from -r requirements.txt …Run Code Online (Sandbox Code Playgroud) Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/beautifulsoup4-4.6.0.dist-info'Consider using the `--user` option or check the permissions.
Run Code Online (Sandbox Code Playgroud)
上面的错误是我尝试使用pip命令时得到的错误.我需要做的就是pip安装requirements.txt以使我的程序正常工作.我安装了python 2.7.1并将我的代码放在我可以使用python命令的地方.我尝试使用此命令更改权限:
chmod -R 777
Run Code Online (Sandbox Code Playgroud)
但它不起作用.我在我的电脑上安装了自制软件.我还尝试使用这个链接使用虚拟环境:http: //sourabhbajaj.com/mac-setup/Python/virtualenv.html但它也给了我许可问题.有没有建议摆脱这个权限问题并成功运行pip?下面的sudo命令也不起作用.
sudo pip install -r requirements.txt
Run Code Online (Sandbox Code Playgroud) 感谢您花时间阅读这篇文章!
我目前正在 Ubuntu 18.04 LTS 上构建一个使用 Python、Flask、Docker、Docker-compose 和 Postgres 的应用程序。以前,docker-compose 构建会成功,一切都按计划进行。但是,现在我切换到另一个 Dockerfile,并且不再使用先前 Dockerfile 的缓存版本,构建会中断并出现以下错误:
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.7/__pycache__/__future__.cpython-37.pyc.140409285875056'
dpkg: error processing package python3.7-minimal (--configure):
installed python3.7-minimal package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
python3.7-minimal
Run Code Online (Sandbox Code Playgroud)
我尝试过以下(Stackoverflow)帖子:
但可惜,无济于事。
我正在使用以下文件:
Dockerfile.prod
# pull official base image
FROM python:3.9.0-slim-buster
# set working …Run Code Online (Sandbox Code Playgroud) 我在 Mac OS X 上,我听说为了避免可能导致 OS X 使用的 python 文件出现问题的包的全局安装(使用 sudo),安装 python 包的路径必须与 OS X 的路径不同.
目前 python 可执行文件安装在:
/usr/local/bin/
Run Code Online (Sandbox Code Playgroud)
Pip 在这里安装模块:
/usr/local/lib/python2.7/site-packages
Run Code Online (Sandbox Code Playgroud)
Python从这里使用:
/usr/local/bin/python
Run Code Online (Sandbox Code Playgroud)
这些路径安全吗?
我试图在aws ec2实例上运行一个小的python代码(需要pytz和其他一些软件包).当我尝试安装pytz时,我遇到了一些错误:
[ec2-user@ip-172-31-28-178 ~]$ pip install pytz
Collecting pytz
Using cached pytz-2016.7-py2.py3-none-any.whl
Installing collected packages: pytz
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", …Run Code Online (Sandbox Code Playgroud) pip ×8
python ×7
macos ×3
amazon-ec2 ×1
bash ×1
django ×1
django-1.10 ×1
docker ×1
ipython ×1
matplotlib ×1
opencv ×1
packages ×1
permissions ×1
postgresql ×1
python-2.7 ×1
python-3.7 ×1
python-3.x ×1
pythonpath ×1
sudo ×1
terminal ×1
virtualenv ×1