-1

code

import gym

env = gym.make("mountainCar-v0")

code conda environment

selected environment and installed packages

error

all the required packages are install in the conda environment but still cant import opengym lib.

(gym) F:\pycharm document making folder>python mountaincar.py
Traceback (most recent call last):
  File "mountaincar.py", line 2, in <module>
    import gym
  File "E:\anaconda install hear\envs\gym\lib\site-packages\gym\__init__.py", line 13, in <module>
    from gym import vector
  File "E:\anaconda install hear\envs\gym\lib\site-packages\gym\vector\__init__.py", line 6, in <module>
    from gym.vector.async_vector_env import AsyncVectorEnv
  File "E:\anaconda install hear\envs\gym\lib\site-packages\gym\vector\async_vector_env.py", line 2, in <module>
    import multiprocessing as mp
  File "F:\pycharm document making folder\multiprocessing.py", line 21
    for f in concurrent.futures.as_completed()
                                             ^
SyntaxError: invalid syntax

selected environment and the installed packages are shown in the images.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
shavendra
  • 1
  • 1
  • Please do not share information as images unless absolutely necessary. See: https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors, https://idownvotedbecau.se/imageofcode, https://idownvotedbecau.se/imageofanexception/. – AMC Mar 22 '20 at 01:21
  • Also, it looks like you installed many of those packages (scipy, NumPy, etc.) using pip, is that the case? – AMC Mar 22 '20 at 01:22

1 Answers1

1

you have a file named multiprocessing.py in F:\pycharm document making folder that has a syntax error.

you should not have a file named multiprocessing.py as that is a builtin module that you are shadowing...

Joran Beasley
  • 110,522
  • 12
  • 160
  • 179