openai / baselines

OpenAI Baselines: high-quality implementations of reinforcement learning algorithms
MIT License
15.63k stars 4.86k forks source link

Crash on import #57

Closed ahundt closed 7 years ago

ahundt commented 7 years ago

I'm trying to run some example code in pybullet, see https://github.com/bulletphysics/bullet3/issues/1234#issuecomment-316521093, that is using baselines but I'm getting an error on import, and they mentioned this is most likely an upstream issue.

I'm on python 2.7.13 on OS X. Perhaps this is a problem with baselines?

athundt at Andrews-2013-MacBook-Pro-2 in ~/src/bullet3/examples/pybullet/gym on master!
± python train_pybullet_racecar.py
pybullet build time: Jul 17 2017 18:59:54
Couldn't import dot_parser, loading of dot files will not be possible.
Traceback (most recent call last):
  File "train_pybullet_racecar.py", line 4, in <module>
    from baselines import deepq
  File "/usr/local/lib/python2.7/site-packages/baselines/deepq/__init__.py", line 2, in <module>
    from baselines.deepq.build_graph import build_act, build_train  # noqa
  File "/usr/local/lib/python2.7/site-packages/baselines/deepq/build_graph.py", line 71, in <module>
    import baselines.common.tf_util as U
  File "/usr/local/lib/python2.7/site-packages/baselines/common/tf_util.py", line 3, in <module>
    import builtins
ImportError: No module named builtins

train_kuka_grasping.py

± python train_kuka_grasping.py
pybullet build time: Jul 17 2017 18:59:54
Couldn't import dot_parser, loading of dot files will not be possible.
Traceback (most recent call last):
  File "train_kuka_grasping.py", line 4, in <module>
    from baselines import deepq
  File "/usr/local/lib/python2.7/site-packages/baselines/deepq/__init__.py", line 2, in <module>
    from baselines.deepq.build_graph import build_act, build_train  # noqa
  File "/usr/local/lib/python2.7/site-packages/baselines/deepq/build_graph.py", line 71, in <module>
    import baselines.common.tf_util as U
  File "/usr/local/lib/python2.7/site-packages/baselines/common/tf_util.py", line 3, in <module>
    import builtins
ImportError: No module named builtins

tf version:

± python -c 'import tensorflow as tf; print(tf.__version__)'
1.2.0

I installed by running pip install baselines, and a full list of installed packages is at https://github.com/bulletphysics/bullet3/issues/1234#issuecomment-316520945

siemanko commented 7 years ago

Python 2.7 is not supported. Please use Python 3.0

ahundt commented 7 years ago

Easier said than done... Thanks for explaining the reason though.

ahundt commented 7 years ago

@siemanko Also perhaps the python2 pip package should then be removed or somehow disabled, I installed the package via pip and the install succeeded.

ClaireCJS commented 1 year ago

Heck, I've been using my personal utility library for days and mid-day today with no change the mere import of openai in python crashes not just the python script, but the entire calling process.

I changed nothing.

Uninstalling from pip and re-installing.. a mere "open ai" crashes the window entirely. It's insane.

ClaireCJS commented 1 year ago

And now it is working again. Go figure On Tue, Jun 6, 2023 at 10:35 PM Claire CJS @.***> wrote:

Heck, I've been using my personal utility library for days and mid-day today with no change the mere import of openai in python crashes not just the python script, but the entire calling process.

I changed nothing.

— Reply to this email directly, view it on GitHub https://github.com/openai/baselines/issues/57#issuecomment-1579775769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGAYV4I5OU2RJNEVOBLDBLXJ7SFLANCNFSM4DTVLS6A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Cheers, -Claire