I'm trying to set up OpenAI's gym on Windows 10, so that I can do machine learning with Atari games.
On PyCharm I've successfully installed gym using Settings > Project Interpreter. But when I try to set up a breakout environment (or any other Atari game) using:
import gym
env = gym.make('BreakoutDeterministic-v4')
I get the following error:
ImportError: No module named 'atari_py'
...
HINT: you can install Atari dependencies by running 'pip install gym[atari]'
So I tried the command 'pip install gym[atari]' in the PyCharm terminal, and got the error:
Unable to execute 'make build -C atari_py/ale_interface -j 11'. HINT: are you sure `make` is installed?
error: [WinError 2] The system cannot find the file specified
I tried installing 'make' from http://gnuwin32.sourceforge.net/packages/make.htm, and tried some other methods, but this didn't solve the problem.
I've also tried 'pip install atari_py', which runs fine but also doesn't solve the problem.
Any ideas/help would be much appreciated. I'm new to Python and PyCharm, so I apologise if any of this was unclear. Please let me know if there's any more info I can provide to help.
Thanks in advance
The gym documentation https://github.com/openai/gym#installing-everything says that for using all the environments, you should have installed dependencies through pip install 'gym[all]'. Can you run this command preferably through the terminal and see if it works?
We currently support Linux and OS X running Python 2.7 or 3.5 -- 3.7.
Windows support is experimental - algorithmic, toy_text,
classic_control and atari should work on Windows (see next section for
installation instructions); nevertheless, proceed at your own risk.
https://github.com/openai/gym#supported-systems
I ended up using Windows subsystem for Linux to run OpenAI Gym with Atari on Windows 10.
I have written a complete guide here.
Works great!
Related
i am quite trouble why my pycharm does not recognize import serial. i am doing python code but i need to use Serial. so just from what i found:
i need to go to CMD, then enter "pip install pyserial" or "pip3 install pyserial"(this is what i did).
after that the installation seems successful, i didnt see any errors
after that. i went back to my Pycharm and type import serial or import pyserial
despite that, both code are not working...
i wonder what is the problem with my Python?
-Windows 10
-Python 3.10
-Pycharm Community Version: 2021.2.3
I had the same problem since I started using python 3.10.
I found that you have to download the complete pyserial package from github, unzip the entire package and edit the setup.py file and add the line 'Programming Language :: Python :: 3.10',
and then from the CMD window run python setup.py build
With that it works !!!
Just open the terminal within the Pycharm IDE and use pip to install on there.
Try uninstalling it from pip and then using the Python Packages tab to install it. It worked for me when I tried that.
The steps leading to the problem is as follows:
I installed a package using pip. The package is here and its install doc is here. The command I used is
pip install --upgrade tensorflow-graphics-gpu
Because I don't have super user privilege, the package was installed in my user space. pip prompted me for that.
I uninstalled the package using
pip uninstall tensorflow-graphics-gpu
I started python3 and type
import tensorflow as tf
This statement worked fine before. But this time, python quits with an error:
Segmentation fault (core dumped)
This is a screenshot: enter image description here.
The environment is as follows:
A remote Linux. Core version 5.8.0. I am not not a super user.
Python 3.8.6
CUDA 11.1
CPU: Core i9-10900K
nVidia RTX GPU
The same error crashes python if I tried to import PyTorch. The sys admin is very disagreeable so I can get no help from him, not to mention upgrading drivers or reinstalling python. I tried to clear cashes in my user space that I know of, but I didn't have luck. I searched internet for a solution but of no avail.
Can someone please tell me how to fix this issue? Thanks a lot.
I tried to clear cashes in my user space that I know of, but I didn't have luck.
It seems pretty clear that something in your $HOME directory is still being used, and is causing the system python to crash.
To discover what that something is, you can look at which files are being opened using this command:
strace -e file python -c 'import tensorflow'
Once you know which files are being opened, remove/reinstall corresponding packages, and you should be back in business.
I have recently installed the latest OpenVINO release (2018 R5 0.1) for Windows 10 which, if I understood correctly, comes with a fully built OpenCV. Many tutorials show the use of that OpenCV but I failed to make it work on my Anaconda environment (with Python 3.6).
Running the environement setup C:\Intel\cvsdk\bin\setupvars.bat script I get the following output:
Commande ECHO désactivée.
PYTHONPATH=C:\Intel\computer_vision_sdk_2018.5.456\python\python3.6;C:\Program Files\Python36;
[setupvars.bat] OpenVINO environment initialized
In my conda env, if I have no opencv package installed, I get the error:
ModuleNotFoundError: No module named cv2
And if I install one with conda install py-opencv (or opencv), I get this:
cv2.error: OpenCV(3.4.2) [...] Build OpenCV with Inference Engine to enable loading models from Model Optimizer
Installing with pip (pip install opencv-python) while on the anaconda environment also doesn't work:
cv2.error: OpenCV(4.0.0) [...] Build OpenCV with Inference Engine to enable loading models from Model Optimizer
For clarification, I have successfully built the opencv examples with CMake and can run the executables. Here is the output of one of their sample programs:
(OpenVino) C:\Intel\computer_vision_sdk_2018.5.456\opencv\build\Debug>openvino_sample_opencv_version.exe
Welcome to OpenCV 4.0.1-openvino
Clearly, that OpenCV is usable somehow, I just can't find how to use it in my conda environment from a python script.
you need to run
C:\Intel\cvsdk\bin\setupvars.bat
every time you activate the enviroment
For a clean installation of openVINO & anaconda should be enough to run the environment setup, as mentioned here, for Jupyter notebooks however could be better to run it explicitly at the beginning with:
PC
!C:\Intel\...\bin\setupvars.bat
Mac
!source /opt/intel/openvino/bin/setupvars.sh
I solved the problem by using windows command prompt rather than power shell, which is recommended by the official open-vino doc.
Append OpenVINO python path in the beginning of your python code as shown below:
import sys
sys.path.append("C:\Intel\computer_vision_sdk_<version_number>\python\python3.6")
For eg:
sys.path.append("C:\Intel\computer_vision_sdk_2018.5.456\python\python3.6")
I have been trying to install Tensorflow for a really long time now, but I never seem to make it work. I have tried to install Tensorflow via pip, virtual environment and anaconda so far. The installation process seem to run smoothly with all three methods. But as soon as I try to validate the installation by running "import tensorflow" I get the following error. I know it looks kind of chaotic, I wasn't sure how to pose the question.
By now, all help is appreciated
Thanks
As mentioned, you have to install python 3.5.X first
Secondly, I strongly recommend you to use anaconda. You should install anaconda 4.4.0 for python 3.6 version and 64-bit installer.
Then, you should run the following command
conda create -n tensorflow python=3.5
By the way, would you watch the tensorflow installation tutorial ?
TensorFlow versions 1.2 and later are compatible with Python 3.6. The error message points to the actual problem:
ImportError: libcudnn.so.5: cannot open shared object file: No such file or directory
This implies two things:
You have installed the tensorflow-gpu package, which requires a CUDA-capable GPU and a working installation of CUDA and cuDNN.
TensorFlow cannot find cuDNN.
This answer explains how to fix your cuDNN installation.
Update:
I get a similar error but the message in the bottom is now:
"ImportError libnvidia-fatbinaryloader.so.384.47: cannot open shared object file: No such file or directory"
Also when I enter "which nvcc" it returns /usr/bin/nvcc
Well, I am so tired of trying to install Tensorflow in Anaconda, I have installed anaconda successfully, but when I am going to install form this link, Anaconda installation on Step 4, I am seeing some exception.
I have executed this line of command
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl
However it's terminating showing a red single line exception.
Later I have searched for some solution on here and there. I have found some solution too. In this solution is done for only MAC OX and Linux only, not for Windows. Later I found somewhere to use the python version 2.7 so I have downgraded the Python in lower version, however it was same. But this time I can able to to execute the MAC OX command successfully and in my prompt it shows that install successful. But when I had gone to import Tensorflow then again an error is threading, like this
I have also found the some other solutions link1 link2, however none of them are done in which process I'm approaching. I am in a quiet confusion what kind of error or exception it is? And how do I overcome it?
Update:
Tensorflow has been installed successfully from this link, Now a different problem is being facing. When I am going to import tensorflow in my workspace it providing this error.
It looks like it cannot find the required CUDA libraries. Did you install the CUDA Toolkit 8.0 and cuDNN 5.1?
You will have to install the CUDA Toolkit 8.0 e.g. from here and the cuDNN package from e.g. here and then put the cuDNN-installation-path/win10/bin on your path (depending on your windows version of course)
Also the following two posts might help you out:
On Windows, running "import tensorflow" generates No module named "_pywrap_tensorflow" error
TensorFlow on Windows: "Couldn't open CUDA library cudnn64_5.dll"