Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python+;Pycharm=pbm安装lxml&;cairosvg';当前用户不拥有的目录';_Python_Lxml_Pycairo_Pygal - Fatal编程技术网

Python+;Pycharm=pbm安装lxml&;cairosvg';当前用户不拥有的目录';

Python+;Pycharm=pbm安装lxml&;cairosvg';当前用户不拥有的目录';,python,lxml,pycairo,pygal,Python,Lxml,Pycairo,Pygal,使用Pycharm,我正在尝试安装Pygall,它需要lxml和cairosvg。 我创建了一个“requirements.txt”文件来列出模块: 已执行命令: pip install lxml 错误: 0:425: execution error: The directory '/Users/romain/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cac

使用Pycharm,我正在尝试安装Pygall,它需要lxml和cairosvg。 我创建了一个“requirements.txt”文件来列出模块:

已执行命令:

pip install lxml
错误:

0:425: execution error: The directory '/Users/romain/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
输出:

0:425: execution error: The directory '/Users/romain/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The directory '/Users/romain/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Command "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__='/private/var/folders/ml/g1gqdlfs4k36b_rpfk44hfrm0000gn/T/pycharm-packaging11.tmp/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/ml/g1gqdlfs4k36b_rpfk44hfrm0000gn/T/pip-DMEwQL-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ml/g1gqdlfs4k36b_rpfk44hfrm0000gn/T/pycharm-packaging11.tmp/lxml (1)
Pycharm为我提供了一个解决方案:

Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7'.
我试图从命令行安装,但随后收到一条“已满足”消息:

$ pip install lxml
Requirement already satisfied (use --upgrade to upgrade): lxml in ./anaconda/lib/python2.7/site-packages

所以我想我必须改变Pycharm里面的用户。。。我该怎么做?在弹出窗口中,我试图仅用我的名字(我用作sudo帐户)来更改我的全名(名字+姓氏),但我得到了相同的错误…

sudo pip install lxml
应该可以解决Linux上的任何权限问题


如果您在Windows计算机上,右键单击命令提示符并选择“以管理员身份运行”,然后执行pip安装命令

给定路径
/Users/romain/Library/Caches/pip/http
,他在OS X上,因此他应该使用Linux(事实上,universal*nix)解决方案问题是如何在Pycharm内做到这一点。。。在命令行上进行sudopip安装已经告诉我该软件包已安装。我猜Pycharm在某处使用了一种virtualenv,或者使用了特定于会话的用户。。。它的定义在哪里,如何更改???@romainjouin默认情况下,PyCharm不创建或使用任何虚拟Python环境。我意识到我是通过anaconda安装Python的,现在我的笔记本电脑中有几个Python2.7解释器。。。Pycharm没有为pip使用好的解释器:我不得不更改项目python解释器来解决这个问题:)你试过chmod-r了吗?