Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/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-Can';t在Mac OS中安装gensim_Python_Macos_Python 2.7_Pycharm_Gensim - Fatal编程技术网

python-Can';t在Mac OS中安装gensim

python-Can';t在Mac OS中安装gensim,python,macos,python-2.7,pycharm,gensim,Python,Macos,Python 2.7,Pycharm,Gensim,当我使用PyCharm安装gensim包时,安装失败。 下面列出了错误消息: chenguanyingdeMacBook-Pro:~ ChenGuanYing$ sudo pip install gensim Password: The directory '/Users/ChenGuanYing/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has

当我使用PyCharm安装gensim包时,安装失败。 下面列出了错误消息:

chenguanyingdeMacBook-Pro:~ ChenGuanYing$ sudo pip install gensim
Password:
The directory '/Users/ChenGuanYing/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 8.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The directory '/Users/ChenGuanYing/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.
Collecting gensim
  Downloading gensim-0.12.4-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.5MB)
    100% |████████████████████████████████| 2.5MB 178kB/s 
Requirement already satisfied (use --upgrade to upgrade): scipy>=0.7.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from gensim)
Collecting smart-open>=1.2.1 (from gensim)
  Downloading smart_open-1.3.2-py2-none-any.whl
Collecting six>=1.5.0 (from gensim)
  Downloading six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.3 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from gensim)
Collecting boto>=2.32 (from smart-open>=1.2.1->gensim)
  Downloading boto-2.39.0-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 312kB/s 
Collecting bz2file (from smart-open>=1.2.1->gensim)
  Downloading bz2file-0.98.tar.gz
Collecting requests==2.8.1 (from smart-open>=1.2.1->gensim)
  Downloading requests-2.8.1-py2.py3-none-any.whl (497kB)
    100% |████████████████████████████████| 499kB 948kB/s 
Collecting httpretty==0.8.10 (from smart-open>=1.2.1->gensim)
  Downloading httpretty-0.8.10-py2-none-any.whl
Installing collected packages: boto, bz2file, requests, httpretty, smart-open, six, gensim
  Running setup.py install for bz2file
  Found existing installation: requests 2.7.0
    Uninstalling requests-2.7.0:
      Successfully uninstalled requests-2.7.0
  Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py", line 299, in run
    root=options.root_path,
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_install.py", line 726, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_uninstall.py", line 125, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/utils/__init__.py", line 314, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-vV05uu-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'


我也使用pip进行安装,但也失败了。。。。 下面列出了错误消息:

chenguanyingdeMacBook-Pro:~ ChenGuanYing$ sudo pip install gensim
Password:
The directory '/Users/ChenGuanYing/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 8.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The directory '/Users/ChenGuanYing/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.
Collecting gensim
  Downloading gensim-0.12.4-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.5MB)
    100% |████████████████████████████████| 2.5MB 178kB/s 
Requirement already satisfied (use --upgrade to upgrade): scipy>=0.7.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from gensim)
Collecting smart-open>=1.2.1 (from gensim)
  Downloading smart_open-1.3.2-py2-none-any.whl
Collecting six>=1.5.0 (from gensim)
  Downloading six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.3 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from gensim)
Collecting boto>=2.32 (from smart-open>=1.2.1->gensim)
  Downloading boto-2.39.0-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 312kB/s 
Collecting bz2file (from smart-open>=1.2.1->gensim)
  Downloading bz2file-0.98.tar.gz
Collecting requests==2.8.1 (from smart-open>=1.2.1->gensim)
  Downloading requests-2.8.1-py2.py3-none-any.whl (497kB)
    100% |████████████████████████████████| 499kB 948kB/s 
Collecting httpretty==0.8.10 (from smart-open>=1.2.1->gensim)
  Downloading httpretty-0.8.10-py2-none-any.whl
Installing collected packages: boto, bz2file, requests, httpretty, smart-open, six, gensim
  Running setup.py install for bz2file
  Found existing installation: requests 2.7.0
    Uninstalling requests-2.7.0:
      Successfully uninstalled requests-2.7.0
  Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py", line 299, in run
    root=options.root_path,
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 640, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_install.py", line 726, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_uninstall.py", line 125, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/utils/__init__.py", line 314, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-vV05uu-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'


谢谢你的帮助,很抱歉我的英语很差。

首先,我安装了NumPy和SciPy。
然后我成功安装了gensim

Gensim需要Python、SciPy和Numpy及其相应的版本。 你可以在这里找到他们:
我建议您使用Anaconda安装它们。

要授予您更改该文件夹内容的权限,您可以执行以下操作:

sudo chown -R $(whoami):admin /library/Python/2.7
当我遇到一个错误:13时,这对我起了作用