apple / tensorflow_macos

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

installing on an exsisting env issue #149

Open david-tao-as01 opened 3 years ago

david-tao-as01 commented 3 years ago
(base) davidtaoas01:tensorflow_macos/ $ sudo sh install_venv.sh /Library/Python/3.8/ -y                                                                                                    [1:58:56]

###########################################################################

install_venv.sh will perform the following operations:
-> Install tensorflow_macos 0.1a1 into existing virtual environment /Library/Python/3.8.
-> Install bundled binary wheels for numpy-1.18.5, grpcio-1.33.2, h5py-2.10.0, tensorflow_addons-0.11.2+mlcompute into /Library/Python/3.8.

>> Installing and upgrading base packages.
WARNING: The directory '/Users/davidtaoas01/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip==20.2.4
  Downloading pip-20.2.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.4 MB/s 
Collecting wheel
  Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting setuptools
  Downloading setuptools-53.0.0-py3-none-any.whl (784 kB)
     |████████████████████████████████| 784 kB 8.0 MB/s 
Collecting cached-property
  Downloading cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Collecting six
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: pip, wheel, setuptools, cached-property, six
  Attempting uninstall: pip
    Found existing installation: pip 20.2.4
    Uninstalling pip-20.2.4:
      Successfully uninstalled pip-20.2.4
  Attempting uninstall: wheel
    Found existing installation: wheel 0.36.2
    Uninstalling wheel-0.36.2:
      Successfully uninstalled wheel-0.36.2
  Attempting uninstall: setuptools
    Found existing installation: setuptools 53.0.0
    Uninstalling setuptools-53.0.0:
      Successfully uninstalled setuptools-53.0.0
  Attempting uninstall: cached-property
    Found existing installation: cached-property 1.5.2
    Uninstalling cached-property-1.5.2:
      Successfully uninstalled cached-property-1.5.2
  Attempting uninstall: six
    Found existing installation: six 1.15.0
    Uninstalling six-1.15.0:
      Successfully uninstalled six-1.15.0
Successfully installed cached-property-1.5.2 pip-20.2.4 setuptools-53.0.0 six-1.15.0 wheel-0.36.2
WARNING: You are using pip version 20.2.4; however, version 21.0.1 is available.
You should consider upgrading via the '/Library/Python/3.8/bin/python3 -m pip install --upgrade pip' command.
>> Installing bundled binary dependencies.
WARNING: The directory '/Users/davidtaoas01/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing ./arm64/numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl
Installing collected packages: numpy
Successfully installed numpy-1.18.5
ERROR: Exception:
Traceback (most recent call last):
  File "/Library/Python/3.8/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
    status = self.run(options, args)
  File "/Library/Python/3.8/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/Library/Python/3.8/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 455, in run
    self._handle_target_dir(
  File "/Library/Python/3.8/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 463, in _handle_target_dir
    ensure_dir(target_dir)
  File "/Library/Python/3.8/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 114, in ensure_dir
    os.makedirs(path)
  File "/Library/Python/3.8/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Library/Python/3.8/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Library/Python/3.8/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/lib'
WARNING: You are using pip version 20.2.4; however, version 21.0.1 is available.
You should consider upgrading via the '/Library/Python/3.8/bin/python3 -m pip install --upgrade pip' command.

I kept getting this error after it finished numpy's installation. Tried to change the permission of the whole folder but it doesn't work.

Trying to install it on conda-forge-arm64 platform at python 3.8.6 .

hoytak commented 3 years ago

First, I don't recommend installing experimental packages into the system python directories using sudo, as that can mess up the system python installation and cause lots and lots of pain. Installing it into a user virtual env would be much safer. To do that, simply pass in another non-system path that you have write access to, and it will work fine.

That said, /Library/Python/3.8 isn't the location of the system python environment; that gets installed into /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/. /Library/Python/3.8 doesn't exist, and system integrity protection doesn't allow even root to create it outside of some standard installation paths. (There is an issue in the command line tools python's sysconfig where it improperly reports the python library path as /Library/Python/3.8 instead of /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/, and perhaps this is where the path you're using comes from.)