Trouble installing OpenAI's gym - python

I would like to install the entire Open AI gym package.
After (I am on a mac) brew install cmake , sudo pip install gym[all] gives me the following error
I am using anaconda 4.3.22. I am not in a conda virtual environment. which python outputs /anaconda/bin/python. The interpreter that anaconda uses is python 3.6.1. Just running sudo pip gym (which must be the minimal version) ran fine.
Thanks for the help.

I have successfully installed gym on my mac laptop, and brew install swig will solve the problem.

Related

Error while installing PyAudio on M1 Macbook even after installing portaudio

I have installed Xcode and Homebrew. Then I have also installed the portaudio package using Homebrew brew install portaudio. After doing that, I have tried to install PyAudio.
I have tried all the following commands:
pip install pyaudio
python3 -m pip install pyaudio
conda install -c anaconda pyaudio
I am currently trying to install PyAudio on my Conda environment. I am using Miniconda on Macbook M1.
Is there any way to solve this, or if not how am I supposed to build the package and place it in my python site-packages??
Kindly Help.
I solved the issue by removing an unwanted urllib3 folder without METADATA inside my python site-packages folder. And then switched the terminal to run on Rosetta2 and It worked.

Pytorch won't install in PyCharm on MacOS

I'm new to the MacOS and I have recently downloaded PyCharm on it. I was able to successfully install some packages like numpy, matplotlib, sympy, etc. However, Pytorch won't get installed; not through PyCharm nor through the Terminal. These are the commands I tried in the Terminal (other than attempting to install them directly from PyCharm):
pip install torch
pip install torch torchvision torchaudio
I could post the error messages but some are quite lengthy :(
I'm using Python 3.9 interpreter with pip on the latest version (20.2.4) (everything else is also up to date). Running this on the new Mac Mini (running the M1 chip).
Any ideas on what I should do? Thanks!!!
Try building from the source code, run these commands
git clone https://github.com/pytorch/pytorch.git
cd pytorch
git submodule update --init --recursive
python3 setup.py build
python3 setup.py install
Are you using a venv? If so you could try checking the box "install to user's site packages directory" in the Project Interpreter settings when you add a package.

Problems installing astra toolbox in Python

I'm trying to install astra-toolbox for python on windows and I'm getting this error.
Anyone have any ideas?
i have tried to install via pip method but it's not working facing the same error as you. if you go to official installation documentation instructions no method to use pip method is given.
i have anaconda installed in my system so i have tried using these commands source:
conda install -c astra-toolbox astra-toolbox
conda install -c astra-toolbox/label/dev astra-toolbox
this solve the issue and astra-toolbox is installed in my system.
PS. this will downgrade package in anaconda. so better to install in separate python environment.

Can't install tensorflow with pip or anaconda

Does anyone know how to properly install tensorflow on Windows?
I'm currently using Python 3.7 (also tried with 3.6) and every time I get the same "Could not find a version that satisfies the requirement tensorflow-gpu (from versions: )
No matching distribution found for tensorflow-gpu" error
I tried installing using pip and anaconda, both don't work for me.
Found a solution, seems like Tensorflow doesn't support versions of python after 3.6.4. This is the version I'm currently using and it works.
Tensorflow or Tensorflow-gpu is supported only for 3.5.X versions of Python. Try installing with any Python 3.5.X version. This should fix your problem.
Here is what i did to get tensorflow working with windows.
Download python 3.7.0 (64 bit from Python Releases for Windows) Install it and check python version by running below command in cmd:
python --version
Python 3.7.0
Then run below command to upgrade pip to latest
python -m pip install --upgrade pip
Now install tensorflow using pip
pip install tensorflow
That's it you have installed tensorflow on windows. Below image shows what happens when you type above commands
link for tensorflow for python 3x
https://pypi.org/project/tensorflow/#files
tensorflow-1.14.0-cp37-cp37m-win_amd64.whl (68.3 MB)
Unfortunately, tensorflow can't installed correctly on python 3.7 and last version of anaconda: so, the best and effective way to do this is to downgrade your python to python 3.6.7 use the next steps:
1- download the latest version of Anaconda
use Anaconda prompt with administrator privilege
2- conda install python=3.6.7 (need a long time)
3-conda install tensorflow
4- conda install keras
5- conda install numpy
Check whether you have a CPU or GPU, if your system doesn't have GPU, then it will generate error.
If you are going to install tensorflow using Windows command prompt (assuming python is already installed), then just run the following command. Go to the root directory, preferably 'C:' drive then run
For GPU- pip3 install --upgrade tensorflow-gpu
For CPU- pip3 install --upgrade tensorflow
If you are using Anaconda, then open Anaconda Navigator->Environments->Select 'All' from the drop down menu and then search TensorFlow. If you are using CPU, then select 'tensorflow', else for GPU select 'tensorflow-gpu'. Then click Apply.
Screenshot of Anaconda Navigator-In case you are not familiar where to look.
Download the latest version of anaconda from here
I'm using Anaconda 2019.03 for Windows Installer, Python 3.7, 64-bit
Upgrade pip as:
python -m pip install --upgrade pip
(a). Install tensorflow using pip3 as:
pip3 install --user --upgrade tensorflow
(b). If you installed anaconda with all users mode. The above
command will become:
pip3 install --upgrade tensorflow
Check installation success as:
python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
As of Feb 2020, Tensorflow is not supported for Python 3.8+
To make it work install a virtualenv w/ Python 3.7 from here: https://www.python.org/downloads/windows/
Tensorflow pip installation for python version 3.5-3.8 requires pip 19.0 or later, as mentioned in the official tensorflow documentation.
Here is a part of this documentation:
System requirements
Python 3.5–3.8
Python 3.8 support requires TensorFlow 2.2 or later.
pip 19.0 or later (requires manylinux2010 support)
Try running pip install --upgrade pip inside your python3 virtualenv.
You mentioned Anaconda. Do you run your python through there?
If so check in Anaconda Navigator --> Environments, if your current environment have got tensorflow installed.
If not, install tensorflow and run from that environment.
Should work.
I had the same problem that yours, happened that I had python at version 3.7. So for installing the Tensorflow with the GPU support I used:
py -3.6 -m pip install tensorflow-gpu
at a Virtualenv ambient. You can see the documentation behind on this website:
https://docs.python.org/3/installing/index.html
I think that this solution is better than downgrade the Python version.
Actually the easiest way to install tensorflow is:
install python 3.5 (not 3.6 or 3.7) you can check wich version you have by typing "python" in the cmd.
When you install it check in the options that you install pip with it and you add it to variables environnement.
When its done just go into the cmd and tipe "pip install tensorflow"
It will download tensorflow automatically.
If you want to check that it's been installed type "python" in the cmd then some that ">>>" will appear, then you write "import tensorflow" and if there's no error, you've done it!
As of November 2018, Tensorflow is not supported for Python 3.6.4+
What to do:
Downgrade Anaconda's Python from 3.7 or 3.6.5+ to 3.6.4
a. Open Command Prompt, find your Anaconda environment, and change your directory
where anaconda or where python
Example path and cd:
cd C:\ProgramData\Anaconda3\bin
b. While in anaconda3/bin in your Command Prompt, source activate your base Anaconda environment
source activate
c. In your Command Prompt, downgrade your base Anaconda environment
conda install python=3.6.4
d. Install Tensorflow
pip install tensorflow
Further reading:
http://docs.anaconda.com/anaconda/user-guide/faq/#how-do-i-get-the-latest-anaconda-with-python-3-5
As of July 2019, I have installed it on python 3.7.3 using py -3 -m pip install tensorflow-gpu
py -3 in my installation selects the version 3.7.3.
The installation can also fail if the python installation is not 64 bit. Install a 64 bit version first.
This is Manas working as a intern in COE-AI lab(CET,BBSR) under tech machindra.
We faced same error. After a little research, we found that there is a glitch in anaconda python 3.7. It does not install tensorflow through pip or conda install command, even if it does..produces same error..
Here is the solution, install conda environment for python=3.6:
go to the directory where conda is installed
cd anaconda3
conda create -n tensorflow python=3.6
conda activate tensorflow
conda install tensorflow python=3.6
python
Import tensorflow.
steps
Do it twice:
enter image description here
enter image description here
-> Not able to install tensorflow , Here I have a solution that worked for me
Step 1 :
- Check version of python(3.7.3)
- Python must be 64 bit Otherwise tensorflow never ever going to be installed it defiitely gives Error.
Step 2 :
pip install tensorflow==2.0.0
Step 3 :
pip install sklearn==0.0
pip install Pillow==8.0.1
pip install h5py==2.10.0
Step 4 :
pip install keras==2.3.1
Now its ready to use.
In Windows 10 with Python 3.8.5, first i tried directly then it was giving following error:
ERROR: Could not find a version that satisfies the requirement tensorflow==1.15 (from versions: none)
Then i installed successfully in virtual environment shown below:
PS E:\udemy\full_stack_web_ai\deeplearning> .\myenv\Scripts\activate
(myenv) PS E:\udemy\full_stack_web_ai\deeplearning> pip install tensorflow
Collecting tensorflow ###
Downloading tensorflow-2.4.1-cp38-cp38-win_amd64.whl (370.7 MB)
Use virtual environment using:
python -m venv myenv
.\myenv\Scripts\activate
Not Enabling the Long Paths can be the potential problem.To solve that,
Steps include:
Go to Registry Editor on the Windows Laptop
Find the key "HKEY_LOCAL_MACHINE"->"SYSTEM"->"CurrentControlSet"->
"File System"->"LongPathsEnabled" then double click on that option and change the value from 0 to 1.
3.Now try to install the tensorflow it will work.

how to install python3.5 completely and remove python2.7 on Mac?

I have installed python3.5 with commands:
sudo apt-get install python3.5
after
pip install matplotlib
pip install numpy
pip install scikit-learn
It works but only on python2.7.6 installed by default. When I type "python",it show me the interactive shell of python2.7.6. I can use python3.5 by type "python3",but i can't import some library i install such as numpy, scikit-learn, matplotlib but it works in 2.7.6.
How to use all my libraries i install with python3.5 instead of 2.7.6?
pip3 will ensure you're installing packages for python3 if there's confusion with a Python 2.x installed on the same machine.
I figure out the best way to deal with it i think. I download Anaconda from this link (https://www.continuum.io/downloads). Anaconda integrates many academic libraries by default so I choose to download anaconda with the Python 3 version and all libraries going with. So now I can use it in PyCharm.
So creating a new project, I just have to choose the rep of python in my anaconda folder.
Thanks guys.

Categories