我正在尝试安装Neomodel库以在我的Django应用程序中使用Neo4j,但它引发了许多错误:
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 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
copytree(src, real_dst, symlinks=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pytz/__init__.py', '/tmp/pip-rVZOK9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pytz/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-rVZOK9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pytz/__init__.py'")
错误信息的篇幅要长很多,但我把它简化得更简洁。所有错误都是相同的(权限被拒绝)。我尝试使用以下命令安装它:
sudo pip install neomodel
我从未见过这样的错误,真的不知道该怎么做才能修复。欢迎任何帮助。
答案 0 :(得分:2)
您应该避免将sudo
与pip
一起使用。
您可以运行pip install neomodel --user
在没有virtualenv的情况下运行,但通常最好使用virtualenv。