I am trying to set up a ML environment on my new Mac device which has a M1 chip. I followed this guide to get TensorFlow installed. However I do not know how to set up the environment on Pycharm. When I try to install Tensorflow as a package it outputs the following:
ERROR: Could not find a version that satisfies the requirement tensorflow-macos (from versions: none)
ERROR: No matching distribution found for tensorflow-macos
I have tried using different Python versions but it the same output keeps popping.
Could you help me with setting up the environment on Pycharm? More specifically what environment and interpreter should I select?
Thank you.
For me, I always follow this repository (Thanks to Daniel Bourke). Follow this steps which are provided in the repository and I hope this will get the job done. Enjoy <3
https://github.com/mrdbourke/m1-machine-learning-test
Try:
brew install hdf5
export HDF5_DIR=/opt/homebrew/opt/hdf5
pip install --no-binary=h5py h5py
pip install tensorflow-macos
This worked for me.
I use Anaconda on my Macbook Pro M1 and set up a separate environment for each problem. Works fine.
Related
I am trying to install keras in a virtual env but was getting errors. I then tried to install it following the steps on this site: https://www.tutorialspoint.com/keras/keras_installation.htm. The first few installs work but when I ran pip install SciPy I kept getting errors. I found others have encountered issues with installing SciPy on apple silicon online and saw a few recommendations but haven't been able to get anything to work so far. Can anyone help me out? Will I just have to wait for SciPy to release a compatible version?
If its helpful, I am working on a M1 processor with MacOS 11.3.1, and using python 3.8.2.
I have tried using homebrew as outlined here:
https://stackoverflow.com/a/66536896/16461391.
I have tried using miniforge as outlined here:
https://stackoverflow.com/a/66768260/16461391.
I managed to find a way to do it. I'm just posting my answer here in case someone else is stuck on the problem.
The way I did it was by running in terminal:
conda install -c conda-forge keras
then I checked it was installed in my condo env using the anaconda navigator, then I opened the condo environment in pycharm by following the steps here:
https://www.jetbrains.com/help/pycharm/conda-support-creating-conda-virtual-environment.html.
I'm fairly new to interacting with Mac OS through command line but i'm trying to make more of an effort to understand the interaction with it especially when it comes to installing programmes for programming languages. I'm trying to install jupyterlab so i ran
>>> pip install jupyterlab
and something runs so i'm assuming it has been installed somewhere.
However when then run
>>> jupyter lab or >>>jupyterlab
I get for both (command not found)
-bash: jupyterlab: command not found
Now online i've seen regarding the installation it says
"f installing using pip install --user, you must add the user-level bin directory to your PATH environment variable in order to launch jupyter lab."
Now this initially didn't mean too much to me but i've been looking into \bin files when looking at which version of python and i know
>>> which python
gives me the location of the binary for python. Naturally i tried
>>> which jupyterlab
>>> which jupyter lab
but both give me nothing.
I also get this message when i type pip install jupyterlab
Defaulting to user installation because normal site-packages is not
writeable
Requirement already satisfied: jupyterlab in
./Library/Python/2.7/lib/python/site-packages (0.33.12)
Does anyone have any ideas? Firstly do i need to add the user level bin directory to my path environment variable? If so how do i find it and how do i do that? I would really appreciate any advice broken into steps for a complete beginner. I really want to understand this so i can try to prevent issues like this in the future. I should highlight i don't have conda installed and i would like to solve this problem with pip. Thanks!
You should probably try to uninstall jupyterlab because it is installed using Python 2.7
pip uninstall jupyterlab
Then check that jupyter is non-existing by using:
which jupyterlab
And finally reinstall it using pip3 install instead of pip.
For pip to use python3.
pip3 install jupyterlab
Let me know if it worked ;)
I am new to the developer world. I tried to install Python and scikit-learn on my Mac for a new project. I installed the other packages (NumPy, pandas, etc.) which worked. However with scikit-learn I am getting an error. I used pip install sickt-learn and the installation start. For whatever reason I got the error message below.
I am using Python version 3.8.0 (global) on a OSx machine 10.14.6. What did I wrong?
Thank you for your support!
enter image description here
Maybe you should run first:
pip install Cython
For a course I am taking, I need to install the package(?) site into an Anaconda virtual environment. I was able to install the other requirements for the course using the command
pip install 'somename==version'
However, when I ran
pip install 'site==0.0.1'
I got the error message
Could not find a version that satisfies the requirement site (from versions: )
No matching distribution found for site
The only information about site that I can find is (https://libraries.io/pypi/site), but it does not really give much information.
I am using Anaconda 4.4.0 (x86_64) and Python 3.5.3.
Any help would be appreciated. Thanks!
site is internal to the Python interpreter, and is used to initialize machine-specific details of your Python installation.
What's telling you that you need to install this module? Ignore it. It's wrong.
What I did to try and solve this issue:
Using Mac OS X
Using Anaconda distro currently in my computer as the path /Users/hongshuhong/anaconda/
Used conda instead of virtualenv because of my distribution of python. I referred to the guide here and tried to download the same with conda's package manager: https://www.tensorflow.org/versions/master/get_started/os_setup.html#download-and-setup
Tensorflow worked correctly when I created an anaconda env using the command conda create --name ML python=2.7 anaconda to state I'm using 2.7 python, then used this command conda install -c https://conda.anaconda.org/jjhelmus tensorflow
gathered from the Anaconda Cloud to attempt to download it. It worked when I said
$ python
>>> import tensorflow as tf
...
However, it doesn't really fix the issue:
However, I want to use the 3.5 distribution of python, simply to keep up with the times and not use outdated pythons.
I attempted to download it using the same way in python=3.5, but it raised this error when I tried to run the command conda install -c https://conda.anaconda.org/jjhelmus tensorflow :
Hint: the following packages conflict with each other:
- tensorflow
- python 3.5*
Use 'conda info tensorflow' etc. to see the dependencies for each package.
And I ran the conda info tensorflow to see what was going on and I got:
Fetching package metadata: ....
Error: No packages found in current osx-64 channels matching: tensorflow
This is really frustrating me and I'm not sure what to do. If there's no work around for this, I think I'll have to use Anaconda's python 2.7 distribution for TensorFlow experiments. If anyone has any idea how to solve this compatibility issue(or some other kind of issue), I'd be extremely grateful. Thanks.
EDIT: I'm pretty sure TensorFlow supports 3.5 because in their documentations they say they support 2.7 python and 3.3+. If there were no clues as to whether they support 3.5, I would have already given up and used 2.7 by now.
The version of TensorFlow packaged here is version 0.5.
Python 3.x support was introduced in TensorFlow 0.6, so you need to figure out how to install the newest version into Anaconda.
Usually you can install packages into anaconda using pip, but I haven't succeeded with TensorFlow.
EDIT: I just noticed that the documentation hasn't updated the url to the pip-wheel.
To install tensorflow in python 3.5 via pip, use the following command:
$ sudo easy_install --upgrade six
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py3-none-any.whl
This links to ...tensorflow-0.5.0-py2-none-any.whl, which is an older version of tensorflow for python 2.x.
Tensorflow get started page link.