Gym cannot be installed on Pycharm's Project Interpreter.
numpy.distutils.system_info.NotFoundError: Norapack/blas resources found.
I get an error.What is the solution?
add
I am using Windows 10, Python 3.8.1.
I was able to install it by typing pip install gym
at the command prompt, but I was unable to import the gym when I ran the program.
Therefore, when I tried to install Gym from Project Interpreter, I encountered a problem similar to the one above.
Also, on my senior's computer, I ran the same program and it worked properly.
python pip pycharm
Before you answer, it appears that the reason is that the pip and setuptools versions in the new virtualenv environment that PyCharm creates are out of date (or are they not fully deployed?)
If the project interpreter was Python 3.8, pip-19.0.3-py3.8.egg and setuptools-40.8.0-py3.8.egg were in the new virtualenv environment, and setuptools-40.8.0-py3.8.egg remained undeployed.
When I installed "gym" from the "Project Interpreter" in the "Settings" menu, I encountered a question error and could not install it.
The solution should be one of the following:
Pre-build an environment with the original Python and virtualenv (or pipenv or conda) that are not PyCharm, and select the environment as an "existing interpreter" in PyCharm project creation
It's @akiraejiri's method.
In that case, let's keep pip, setuptools, and virtualenv up to date before working.
Dear @akiraejiri, You can install Gym first as the answer.
If pip,setupools are up to date, it seems that Gym can be installed with PyCharm later.
Increase the number of pip,setuptools versions in the new PyCharm virtualenv environment
It is troublesome and requires a lot of steps, but you can also install Gym using this method.
Pre-build an environment with the original Python and virtualenv (or pipenv or conda) that are not PyCharm, and select the environment as an "existing interpreter" in PyCharm project creation
It's @akiraejiri's method.
In that case, let's keep pip, setuptools, and virtualenv up to date before working.
Dear @akiraejiri, You can install Gym first as the answer.
If pip and setupools are up to date, Gym can be installed later with PyCharm.
Increase the number of pip,setuptools versions in PyCharm's new virtualenv environment
There are many troublesome and many steps required, but you can install Gym using this method.
However, I was able to install it, but I may still be missing something because I'm stuttering with a simple program running ahead.
How to create something other than PyCharm first:
pip list-o
to update any old ones to the latest versionvirtualenv-p Python 3.8 project name
to create a new environmentRun the project name\Scripts\activate.bat
to migrate your Python environmentpip list-o
and update any old ones to the latest versiongym
under <+> under Settings > Project Interpreter on the menuUpdate your PyCharm environment:
rd/s/q pip-19.0.3-py3.8.eg
Delete Foldercd..\..
Backcd..\..
BackInstalling pip install-U setuptools-46.1.3-py3-none-any.whl
delete files in del setuptools-40.8.0-py3.8.eg
rd/s/q__pycache__
delete files in delete_install.py
cd..\..
Backdel*.whl
gym
in the rd/s/q pip-19.0.3-py3.8.eg
Delete Foldercd..\..
Backcd..\..
BackInstalling pip install-U setuptools-46.1.3-py3-none-any.whl
delete files in del setuptools-40.8.0-py3.8.eg
rd/s/q__pycache__
delete files in delete_install.py
cd..\..
Backdel*.whl
The installation and import
have been completed, but it has been stumbled by a simple program execution ahead.
Either way, the following program on the first page of the site below has encountered an exception in env.render()
and has not been able to run.
Gym
import gym
env=gym.make("CartPole-v1")
observation=env.reset()
for_in range (1000):
env.render()
action=env.action_space.sample()#youragenthere(this takes random actions)
observation, reward, done, info=env.step(action)
if done:
observation=env.reset()
env.close()
I don't know anything about Gym myself, so maybe I still don't have enough packages or settings._get_pixel_format_descriptor_matching_configs, win32.py:102 pf=_gdi32.ChoosePixelFormat(canvas.hdc,byref(pfd))
and __exception__(<class'OSError'>, OSError('exception:'accordingCad00000000DC
Use Project Interpreter with Gym.
Select or create a new Project Interpreter containing Gym.
At a Windows 10 command prompt, do the following to install Gym:
pip install gym
Click the Settings (Ctrl+Alt+S) gear icon and select Add.
Select Virtualenv and create a Project Interpreter.
VWhen I selected Virtualenv, the package list contained Gym.
As long as Gym is included, I think other options are fine.
In my environment, neither the system interpreter nor the Anaconda Project Interpreter contained Gym.
The above reference was given to Python interpreter.
© 2024 OneMinuteCode. All rights reserved.