每次尝试使用pip或conda安装python软件包时,我都会不断收到此错误:
(base) C:\Users\Might>pip install opengl
Traceback (most recent call last):
File "C:\Users\Might\Anaconda3\Scripts\pip-script.py", line 6, in <module>
from pip._internal import main
File "C:\Users\Might\Anaconda3\lib\site-packages\pip\_internal\__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\Might\Anaconda3\lib\site-packages\pip\_internal\cli\autocompletion.py", line 8, in
<module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\Might\Anaconda3\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in
<module>
from pip._internal.cli import cmdoptions
File "C:\Users\Might\Anaconda3\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 21, in
<module>
from pip._internal.locations import USER_CACHE_DIR, get_src_prefix
File "C:\Users\Might\Anaconda3\lib\site-packages\pip\_internal\locations.py", line 6, in <module>
import platform
File "C:\Users\Might\Anaconda3\Lib\site-packages\OpenGL\platform\__init__.py", line 35, in
<module>
_load()
File "C:\Users\Might\Anaconda3\Lib\site-packages\OpenGL\platform\__init__.py", line 26, in _load
plugin_class = plugin.load()
File "C:\Users\Might\Anaconda3\lib\site-packages\OpenGL\plugins.py", line 16, in load
return importByName( self.import_path )
File "C:\Users\Might\Anaconda3\lib\site-packages\OpenGL\plugins.py", line 38, in importByName
module = __import__( ".".join(moduleName), {}, {}, moduleName)
File "C:\Users\Might\Anaconda3\lib\site-packages\OpenGL\platform\__init__.py", line 35, in
<module>
_load()
File "C:\Users\Might\Anaconda3\lib\site-packages\OpenGL\platform\__init__.py", line 26, in _load
plugin_class = plugin.load()
File "C:\Users\Might\Anaconda3\lib\site-packages\OpenGL\plugins.py", line 16, in load
return importByName( self.import_path )
File "C:\Users\Might\Anaconda3\lib\site-packages\OpenGL\plugins.py", line 38, in importByName
module = __import__( ".".join(moduleName), {}, {}, moduleName)
File "C:\Users\Might\Anaconda3\lib\site-packages\OpenGL\platform\win32.py", line 15, in <module>
size = _size()
File "C:\Users\Might\Anaconda3\lib\site-packages\OpenGL\platform\win32.py", line 14, in _size
return platform.architecture()[0].strip( 'bits' )
AttributeError: module 'platform' has no attribute 'architecture'
我尝试安装其他软件包,但仍然出现相同的错误。一旦我熟悉了Anaconda Navigator,就无法重新打开它,而不得不重新安装整个东西。