Не могу установить netaddr из MacBook - PullRequest
0 голосов
/ 30 марта 2020

В Linux я просто запускаю pip install netaddr и все работает просто отлично. Однако в Ma c OS X версии 10.15.4 это выглядит не так просто:

[myuser:my-macbook-pro:~]$ sudo pip install netaddr                                                                                                                                 2:33PM/03.30
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
WARNING: The directory '/Users/myuser/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/myuser/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting netaddr
  Downloading https://files.pythonhosted.org/packages/ba/97/ce14451a9fd7bdb5a397abf99b24a1a6bb7a1a440b019bebd2e9a0dbec74/netaddr-0.7.19-py2.py3-none-any.whl (1.6MB)
     |████████████████████████████████| 1.6MB 1.6MB/s
Installing collected packages: netaddr
Successfully installed netaddr-0.7.19
[myuser:my-macbook-pro:~]$ python                                                                                                                                                   2:33PM/03.30
Python 2.7.15 (default, Feb 12 2019, 11:00:12)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import netaddr
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named netaddr
>>>

По-прежнему не работает даже при выполнении точно такой же команды с Разрешения sudo.

Любая помощь будет принята с благодарностью. На данный момент мне по-прежнему приходится запускать виртуальную машину для запуска этого сценария, для которого требуется только один модуль.

1 Ответ

0 голосов
/ 30 марта 2020

используйте virtualenv и установите его оттуда https://docs.python-guide.org/dev/virtualenvs/

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...