2

i get this error when tried to import gym, gym is underlined and when i tried to install the package it failed

  • i already updated python to 3.7 and used "conda install -c conda-forge gym"
  • also tried: settings -> project Interpreter

Click on + button on top right corner and you will get pop-up window of Available packages. Then search for gym python package.

Then click on Install package to install the gym package

but i found r-gym not gym

the output error:

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.


PackagesNotFoundError: The following packages are not available from current channels:

  - gym

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org, and use the search bar at the top of the page.

Astrian_72954
  • 411
  • 2
  • 11

1 Answers1

0

First of all, use a virtual environment.

This link will surely help, kindly go through it.

After activating your virtual environment, check and update your python version (if required).

Then for Gym environment, use conda install -c powerai gym

Further Reading, I suggest you go through this once.

Another problem that you might face, is with regards to the CUDA Build, (In case you have updated your python from 3.7 to 3.8), this will look like this (Spyder) and this this (PyTorch). You probably won't face it.

Use the above-stated command and update accordingly, in case you face similar error, it can be solved too but is out of the scope of the current problem.

UPDATE - 1

Try using pip install "gym[atari]" and see if this solves the error if there is still some parsing error, there might be a Library mismatch, update and I will update the answer accordingly.

Astrian_72954
  • 411
  • 2
  • 11
  • 1
    i still have the same error. I'm using env. from the beginning and now used: conda install -c powerai gym as you kindly suggested. which is done without any errors. but when opened pycharm from the cmd "the activated env." and then tried to install gym package got the same error. would you pls help me with another fix. – marian maksimos Aug 05 '20 at 05:36
  • no , but when you asked i used conda terminal and still got the same error – marian maksimos Aug 05 '20 at 05:44
  • That's unexpected, but I will try to look for a different Fix. – Astrian_72954 Aug 05 '20 at 05:45
  • @marianmaksimos I have updated the answer, pls go through it. – Astrian_72954 Aug 05 '20 at 06:02
  • Afterward, just try ```import gym```. Rather than focusing on downloading package from settings. If there is no red underline (implying error), it should work. – Astrian_72954 Aug 05 '20 at 06:05