相关疑难解决方法(0)

将pip包安装到$ HOME文件夹

可能吗?安装时pip,在我的$HOME文件夹中安装python包.(例如,我想安装mercurial,使用pip,但内部$HOME而不是/usr/local)

我正在使用mac机器,只是想到了这种可能性,而不是"污染"我的/usr/local,我会用我的$HOME代替.

PEP370正是如此.只是创建一个˜/.local并做pip install package足以使这些包只安装在我的$ HOME文件夹中?

python pip

323
推荐指数
3
解决办法
29万
查看次数

无法在Mac OS x 10.9上安装Lxml

我想安装Lxml,然后我可以安装Scrapy.

当我今天更新我的Mac时它不会让我重新安装lxml,我收到以下错误:

In file included from src/lxml/lxml.etree.c:314:
/private/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
         ^
1 error generated.
error: command 'cc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

我已经尝试使用brew来安装libxml2和libxslt,两者都安装得很好但我仍然无法安装lxml.

上次我安装时我需要在Xcode上启用开发人员工具,但由于它更新到Xcode 5,它不再给我这个选项了.

有谁知道我需要做什么?

python macos xcode lxml scrapy

233
推荐指数
10
解决办法
9万
查看次数

尝试在MAC上使用pip时被拒绝?

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)

python permissions macos pip python-2.7

8
推荐指数
1
解决办法
2万
查看次数

django安装:不能用pip在linux上安装django(ubuntu)

我尝试使用pip在ubuntu上安装django.但不幸的是我得到了这样的错误.谁能解释一下并告诉我一些方法来解决这个问题?

error: could not create '/usr/local/lib/python2.7/dist-packages/django': Permission denied

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/home/franklingu/build/django   /setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-W5MhGe-record/install-record.txt failed with error code 1
Storing complete log in /home/franklingu/.pip/pip.log
Run Code Online (Sandbox Code Playgroud)

python django pip

4
推荐指数
2
解决办法
1万
查看次数

安装python模块IOError:[Errno 13]权限被拒绝:

我尝试通过键入终端使用pip安装python库openpyxl:

    pip install openpyxl
Run Code Online (Sandbox Code Playgroud)

但它没有正确执行.它引发了一个例外:

    Successfully built openpyxl jdcal et-xmlfile
    Installing collected packages: jdcal, et-xmlfile, openpyxl
    Exception:
    Traceback (most recent call last):
    File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
    File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
    File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
    File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
    File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
    File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
    File "/Library/Python/2.7/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
    File …
Run Code Online (Sandbox Code Playgroud)

python pip permission-denied

1
推荐指数
1
解决办法
1万
查看次数