在 Windows 上执行 pip install psychopy 时出现错误消息
Error messages while doing pip install psychopy on Windows
我在 anaconda spyder 2.7 64 位中安装 psychopy
模块时收到此类消息(附件中的图片)。我以前从来没有得到过这种说明,我想正因为如此,我在 运行 代码
时遇到了这种错误
from pyglet.window import key: ImportError: cannot import name key
cannot import name logging
NameError: name ‘PUINT’ is not defined
如果有人可以分享信息来避免这个问题,那将非常有帮助。
回溯:
Exception:
Traceback (most recent call last):
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\basecommand.py", line
215, in main
status = self.run(options, args)
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\commands\install.py",
line 342, in run
prefix=options.prefix_path,
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\req\req_set.py", line
795, in install
requirement.commit_uninstall()
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\req\req_install.py",
line 767, in commit_uninstall
self.uninstalled.commit()
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\req\req_uninstall.py",
line 142, in commit
rmtree(self.save_dir)
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\_vendor\retrying.py",
line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\_vendor\retrying.py",
line 212, in call
raise attempt.get()
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\_vendor\retrying.py",
line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\_vendor\retrying.py",
line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\utils\__init__.py", line
102, in rmtree
onerror=rmtree_errorhandler)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 266, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\utils\__init__.py", line
114, in rmtree_errorhandler
func(path)
WindowsError: [Error 5] Zugriff verweigert:
'c:\users\ravi\appdata\local\temp\pip-ta7sa2-
uninstall\users\ravi\anaconda2\lib\site-
packages\numpy\core\multiarray.pyd'
错误:
你的问题
您的用户似乎没有在您的系统中安装软件包的权限(对于所有用户)。
解决方案
从命令提示符,您可以仅为您的用户安装包,像这样:
pip install <package> --user
或
您可以按照以下步骤以管理员身份安装软件包:
- 运行 命令提示符作为管理员,使用
Run This Program As An Administrator
选项。
- 运行命令
pip install <package>
我在 anaconda spyder 2.7 64 位中安装 psychopy
模块时收到此类消息(附件中的图片)。我以前从来没有得到过这种说明,我想正因为如此,我在 运行 代码
from pyglet.window import key: ImportError: cannot import name key
cannot import name logging
NameError: name ‘PUINT’ is not defined
如果有人可以分享信息来避免这个问题,那将非常有帮助。
回溯:
Exception:
Traceback (most recent call last):
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\basecommand.py", line
215, in main
status = self.run(options, args)
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\commands\install.py",
line 342, in run
prefix=options.prefix_path,
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\req\req_set.py", line
795, in install
requirement.commit_uninstall()
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\req\req_install.py",
line 767, in commit_uninstall
self.uninstalled.commit()
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\req\req_uninstall.py",
line 142, in commit
rmtree(self.save_dir)
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\_vendor\retrying.py",
line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\_vendor\retrying.py",
line 212, in call
raise attempt.get()
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\_vendor\retrying.py",
line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\_vendor\retrying.py",
line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\utils\__init__.py", line
102, in rmtree
onerror=rmtree_errorhandler)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 261, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Users\Ravi\Anaconda2\lib\shutil.py", line 266, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "C:\Users\Ravi\Anaconda2\lib\site-packages\pip\utils\__init__.py", line
114, in rmtree_errorhandler
func(path)
WindowsError: [Error 5] Zugriff verweigert:
'c:\users\ravi\appdata\local\temp\pip-ta7sa2-
uninstall\users\ravi\anaconda2\lib\site-
packages\numpy\core\multiarray.pyd'
错误:
你的问题
您的用户似乎没有在您的系统中安装软件包的权限(对于所有用户)。
解决方案
从命令提示符,您可以仅为您的用户安装包,像这样:
pip install <package> --user
或
您可以按照以下步骤以管理员身份安装软件包:
- 运行 命令提示符作为管理员,使用
Run This Program As An Administrator
选项。 - 运行命令
pip install <package>