apple / tensorflow_macos

TensorFlow for macOS 11.0+ accelerated using Apple's ML Compute framework.
Other
3.67k stars 308 forks source link

Modules installing problems: Matplotlib, pandas, pillow, seaborne etc. #196

Open liyihai-official opened 3 years ago

liyihai-official commented 3 years ago

Is that issue caused by dependence on scipy ?

ERROR informations:

`

ERROR: Command errored out with exit status 1: command: /Users/micheallea/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/pz/gl5sl4w94hs9dkyd5xz7rllw0000gn/T/pip-install-fwcxu815/pillow_724b6de3b86540a4b21aa8a3813a1c05/setup.py'"'"'; file='"'"'/private/var/folders/pz/gl5sl4w94hs9dkyd5xz7rllw0000gn/T/pip-install-fwcxu815/pillow_724b6de3b86540a4b21aa8a3813a1c05/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/pz/gl5sl4w94hs9dkyd5xz7rllw0000gn/T/pip-wheel-ukj60oet cwd: /private/var/folders/pz/gl5sl4w94hs9dkyd5xz7rllw0000gn/T/pip-install-fwcxu815/pillow_724b6de3b86540a4b21aa8a3813a1c05/ Complete output (176 lines): /Users/micheallea/venv/lib/python3.8/site-packages/setuptools/dist.py:634: UserWarning: Usage of dash-separated 'extend-ignore' will not be supported in future versions. Please use the underscore name 'extend_ignore' instead warnings.warn( /Users/micheallea/venv/lib/python3.8/site-packages/setuptools/dist.py:634: UserWarning: Usage of dash-separated 'max-line-length' will not be supported in future versions. Please use the underscore name 'max_line_length' instead warnings.warn(

`

Aizen741 commented 3 years ago

Is your Env under miniforge? if yes then you can easily download the packages using "conda install < packages you want >"

dhoelzer commented 3 years ago

As far as Pillow, there are no wheels available for M1 ARM for the 3.8 Python that is required by the Apple TensorFlow Alpha. As for me, we found it necessary to build and install Pillow from source.

Prashant-Kesharwani commented 3 years ago

@MichealLea

You can install all the following modules by creating a Virtual Environment, and then installing all these modules inside that Virtual Environment.

1. Install Matplotlib

1.1 Install Homebrew Type in your terminal (not in rosetta environment):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" Then add homebrew's path to the variable path:

echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/bcghostpc/.zprofile eval $(/opt/homebrew/bin/brew shellenv)

1.2 Install libjpeg

brew install libjpeg

1.3 Install Matplotlib

In the virtual environment, type:

pip install matplotlib

2. Install tensorflow

Type in terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/apple/tensorflow_macos/master/scripts/download_and_install.sh)" then name your virtual environment's folder

3. Install pandas

In your virtual environment, type:

pip install cython git clone https://github.com/pandas-dev/pandas.git cd pandas python3 setup.py install

4. Install jupyter notebook

In your virtual environment, type:

pip install notebook Then go to lib/python3.8/site-packages/ipykernel

Edit the eventloops.py file using nano eventloops.py

In the _use_appnope() function, edit the return line as follows:

return sys.platform == 'darwin' and V(platform.mac_ver()[0]) >= V('10.9') and platform.mac_ver()[2] != 'arm64'

Appendix

About Installing Different Modules You can install any module using pip inside Virtual Environment:

pip install <moduleName>

About Virtual Environment

You can create a virtual environment by:

python3 -m venv <name> After creating the environment, you can activate the environment by:

source <name>/bin/activate To exit the environment, type:

deactivate