Cannot build wheel error when trying to install openAI gym - python

I saw that failure to build wheel atari-py, pachi-py was a common problem people ran into when installing openai gym in mac. And the solutions suggested in them was to use export commands export MACOSX_DEPLOYMENT_TARGET=10.11
export SDKROOT=/path/to/Mac10.11SDK before making the build. I tried the given suggestions and yet I am finding the same error when trying to install full openai gym. Can anyone help me in getting around this issue ?

verify if you already installed cmake, if not you can do it with:
$ brew install cmake
and later you can install atari-py:
$ pip install atari-py
Reference in oficial GitHub repo

Related

How to solve the problem of installing django-simple-history?

In my project I need to use django-simple-history but when I run the command: pip install django-simple-history I got the ERROR:
Could not build wheels for django-simple-history, which is required to install pyproject.toml-based projects
Any solutions please, thank you in advance.
Check if you have required Python and Django versions installed ( https://django-simple-history.readthedocs.io/en/latest/ ).
Try to install earlier version of django-simple-history, for Windows:
py -m pip install django-simple-history=="3.0.0"
Let's see if these steps could solve your problem.
Download the files from PyPI
Install the files using pip
python -m pip install ./path/to/file
Last but not least, If you think that is a bug, please consider to submit the issue via Github
Make sure you disable the path length limit in Windows:

Trying to install new libraries on Spyder (Python 3.7)

I am new to python and I am having trouble downloading some new libraries that don't appear to be pre-installed. The names of them are rasterio and retrying. I continuously get an invalid syntax error, and I have tried using some different suggestions found online.
pip install rasterio
Above is the way I was attempting to do it, and I also tried without the pip in there, but neither option worked. I am new enough to the language that troubleshooting is very difficult. Any help is greatly appreciated!
There are several ways to install rasterio, using anaconda you have the documentation here: https://anaconda.org/conda-forge/rasterio
If you are on windows installing rasterio using pip install can be difficult since it requires binary wheels, but here is the tutorial: https://rasterio.readthedocs.io/en/latest/installation.html
I advise you to use linux since it is much easier to install packages, you can either install a dual boot or a virtual box.
I suppose you are using Spyder IDE with Anaconda. So, to install rasterio package you can open anaconda prompt and type:
conda install -c conda-forge rasterio
For further information about package installation check out this link.
Also, to install any conda packages just google it once, you will find instructions to install it mostly in anaconda's official site.
Edit:
Please remove the rasterio package once. And install it again, see if works. If it doesn't work create a new environment like: conda create --name myenv. Then install rasterio again.
If this still doesn't work, try to install rasterio from here like conda install -c ioos rasterio.

Cannot install python-weka-wrapper/javabridge on Google Colab

I am trying to install the python-weka-wrapper on Google Colab using
!pip install python-weka-wrapper
And I am seeing the following output:
Collecting python-weka-wrapper
Using cached https://files.pythonhosted.org/packages/2a/41/19c7bc2e177371cc273cc8aa17d66bd3ef9a6192160eecc56566ea31d959/python-weka-wrapper-0.3.15.tar.gz
Collecting javabridge>=1.0.14 (from python-weka-wrapper)
Using cached https://files.pythonhosted.org/packages/a6/a0/c59bccabed99b1d4ac68166c59c679b375bfca75b78688b52c541b711578/javabridge-1.0.18.tar.gz
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-24j9c0j5/javabridge/
I have successfully checked/installed all Python packages needed:
numpy
pillow
matplotlib
pygraphviz
I faced exactly the same error. Error is due to javabridge (a dependency) installation failing. In my case the error was due to the fact that I did not have JDK installed on my Google Colab Runtime.
Note: Even though JDK folders might be present in your machine (and similarly in Google Colab), doesn't necessarily mean that javac is present or works. Usually most machines have JRE running even though the JDK folders might seem to be present in the /usr/lib/jvm/ directory. That's what confounded me for a long time. So you have to apt install openjdk .
So, after installing openjdk properly and setting the JAVA_HOME properly, javabridge and python-weka-wrapper3 smoothly installed.
I'm summarizing all the commands I used to install python-weka-wrapper3 on Google Colab
import os
import sys
sys.path
sys.path.append("/usr/lib/jvm/java-11-openjdk-amd64/bin/")
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-11-openjdk-amd64/"
!apt-get install build-essential python3-dev
!apt-get install python3-pil python3-pygraphviz
!apt install openjdk-11-jdk
!pip3 install javabridge --no-cache-dir
!pip3 install python-weka-wrapper3 --no-cache-dir
import weka.core.jvm as jvm
jvm.start()
So, I hope this helps! Feel free to ask me any more questions related to this.
Also note while trying to rectify the issue, I came across some posts stating Oracle JDK might be necessary. Complete nonsense. weka-wrapper3 works just fine with openjdk.
The comments from this question helped me in understand the issue to resolve the error when I faced it.

multiple environment coremltools installation

Trying to install coremltools. I installed using pip but that is not the most recent version and I have run into a bug that was solved 4 days so I must build from source. I'm on a Mac virtual desktop(windows user) and I tried cmake, but since there are multiple pythons it keeps trying to install to python 3.7 when I need it to install for python 2.7.10. The github suggest doing this:
cmake . -DPYTHON=$(which python) -DPYTHON_CONFIG=$(which python-config)
.. however as someone who doesn't use cmake for package installs I'm unsure of the correct syntax could someone give me an example statement to go off of, I would really appreciate it. Thanks
You can install it without building it manually:
pip install https://github.com/apple/coremltools/archive/master.zip
You can replace "master" with any branch or tag names.
EDIT: To update an existing install add the -U flag. Or uninstall previous installations.

Pip installing wrong version on win7,

I have a package that I am trying to install via pip install allen-bradley-toolkit. The package is failing with the following reason.
The problem seems to related to the fact that pip is trying to install 1.0a1.post0 instead of the latest release version 2.0.0. Does anyone have any ideas on what to do about this. Perhaps there is something wrong in my deployment script. You can view the Github Library here to see how I am deploying to PyPi.
There is an issue opened on the GitHub Tracker #2 that you can also reference for more info.
NOTE: The package seems to install fine on my win10 machine. But I am unable to get it to install on a win7 VM.
Ive also tried installing with the following commands:
pip install --no-cache-dir allen-bradley-toolkit
pip install allen-bradley-toolkit==2.0.0 -> this ones throws a 'doesnt exist error`
At https://pypi.python.org/pypi/allen-bradley-toolkit/2.0.0 I see that the wheel is only available for Python 3. You're trying to install it with Python 2.7.
To publish a universal wheel (suitable for both Py2 and Py3) you need to set
[bdist_wheel]
universal = 1
in setup.cfg or run
python setup.py bdist_wheel --universal
The 2nd line of the output has a clue to the problem - "Using cached ..."
You can skip the cache using the --skip-cache --no-cache-dir option to pip install or request an upgrade using the -U option
edit: updated comment with the correct option (although, seems like that wasn't the problem in this specific case).

Categories

Resources