Python Twisted twisted.internet - python

I've downloaded twisted from git
git clone -b trunk https://github.com/twisted/twisted.git
as http://twistedmatrix.com/trac/wiki/Downloads suggests.
And then I performed
sudo python setup.py install
But now when I run some python files I get
ImportError: No module named twisted.internet.
I've also noticed, in the README.rst of git, that it doens't mention the module twisted.internet.
So where should I get it?

Don't ever sudo pip install ... anything. Use virtualenv instead.
exarkun#baryon:~$ virtualenv /tmp/virtualenv-demo
Running virtualenv with interpreter /usr/bin/python2
New python executable in /tmp/virtualenv-demo/bin/python2
Also creating executable in /tmp/virtualenv-demo/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
exarkun#baryon:~$ . /tmp/virtualenv-demo/bin/activate
(virtualenv-demo) exarkun#baryon:~$ pip install twisted
Collecting twisted
Collecting constantly>=15.1 (from twisted)
Using cached constantly-15.1.0-py2.py3-none-any.whl
Collecting zope.interface>=3.6.0 (from twisted)
Collecting Automat>=0.3.0 (from twisted)
Using cached Automat-0.5.0-py2.py3-none-any.whl
Collecting incremental>=16.10.1 (from twisted)
Using cached incremental-16.10.1-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /tmp/virtualenv-demo/lib/python2.7/site-packages (from zope.interface>=3.6.0->twisted)
Collecting attrs (from Automat>=0.3.0->twisted)
Using cached attrs-16.3.0-py2.py3-none-any.whl
Requirement already satisfied: six in /tmp/virtualenv-demo/lib/python2.7/site-packages (from Automat>=0.3.0->twisted)
Requirement already satisfied: appdirs>=1.4.0 in /tmp/virtualenv-demo/lib/python2.7/site-packages (from setuptools->zope.interface>=3.6.0->twisted)
Requirement already satisfied: packaging>=16.8 in /tmp/virtualenv-demo/lib/python2.7/site-packages (from setuptools->zope.interface>=3.6.0->twisted)
Requirement already satisfied: pyparsing in /tmp/virtualenv-demo/lib/python2.7/site-packages (from packaging>=16.8->setuptools->zope.interface>=3.6.0->twisted)
Installing collected packages: constantly, zope.interface, attrs, Automat, incremental, twisted
Successfully installed Automat-0.5.0 attrs-16.3.0 constantly-15.1.0 incremental-16.10.1 twisted-17.1.0 zope.interface-4.3.3
(virtualenv-demo) exarkun#baryon:~$ python -c 'import twisted.internet; print twisted.internet'
<module 'twisted.internet' from '/tmp/virtualenv-demo/local/lib/python2.7/site-packages/twisted/internet/__init__.pyc'>
(virtualenv-demo) exarkun#baryon:~$ deactivate
exarkun#baryon:~$

Related

How to downgrade python version without affecting other files

When I am installing tensorflow in python 3.8.0 then it shows error. How to downgrade python version without affecting other files.
(base) C:\Users\Akanksha-Lab-PC>pip uninstall python 3.8.4
WARNING: Skipping python as it is not installed.
WARNING: Skipping 3.8.4 as it is not installed.
(base) C:\Users\Akanksha-Lab-PC>pip uninstall python-3.8.4
WARNING: Skipping python-3.8.4 as it is not installed.
(base) C:\Users\Akanksha-Lab-PC>make altinstall python-3.7
'make' is not recognized as an internal or external command,
operable program or batch file.
(base) C:\Users\Akanksha-Lab-PC>pip install python-3.7
ERROR: Could not find a version that satisfies the requirement python-3.7 (from versions: none)
ERROR: No matching distribution found for python-3.7
When I type the command pip show tensorflow it gives me this
(base) C:\Users\Akanksha-Lab-PC>python --version
Python 3.8.5
(base) C:\Users\Akanksha-Lab-PC>pip show tensorflow
WARNING: Package(s) not found: tensorflow
When I am installing tensorflow by using this command:
pip install tensorflow
it gives this error
(base) C:\Users\Akanksha-Lab-PC>pip install tensorflow
Collecting tensorflow
Using cached tensorflow-2.4.1-cp38-cp38-win_amd64.whl (370.7 MB)
Requirement already satisfied: six~=1.15.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.15.0)
Collecting astunparse~=1.6.3
Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: protobuf>=3.9.2 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (3.14.0)
Requirement already satisfied: typing-extensions~=3.7.4 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (3.7.4.3)
Requirement already satisfied: wheel~=0.35 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.35.1)
Requirement already satisfied: numpy~=1.19.2 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.19.2)
Processing c:\users\akanksha-lab-pc\appdata\local\pip\cache\wheels\a0\16\9c\5473df82468f958445479c59e784896fa24f4a5fc024b0f501\termcolor-1.1.0-py3-none-any.whl
Requirement already satisfied: flatbuffers~=1.12.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.12)
Collecting absl-py~=0.10
Using cached absl_py-0.11.0-py3-none-any.whl (127 kB)
Requirement already satisfied: h5py~=2.10.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (2.10.0)
Collecting keras-preprocessing~=1.1.2
Using cached Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
Requirement already satisfied: google-pasta~=0.2 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.2.0)
Collecting gast==0.3.3
Using cached gast-0.3.3-py2.py3-none-any.whl (9.7 kB)
Collecting grpcio~=1.32.0
Using cached grpcio-1.32.0-cp38-cp38-win_amd64.whl (2.6 MB)
Collecting tensorflow-estimator<2.5.0,>=2.4.0
Using cached tensorflow_estimator-2.4.0-py2.py3-none-any.whl (462 kB)
Collecting tensorboard~=2.4
Using cached tensorboard-2.4.1-py3-none-any.whl (10.6 MB)
Collecting opt-einsum~=3.3.0
Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB)
Processing c:\users\akanksha-lab-pc\appdata\local\pip\cache\wheels\5f\fd\9e\b6cf5890494cb8ef0b5eaff72e5d55a70fb56316007d6dfe73\wrapt-1.12.1-py3-none-any.whl
Collecting google-auth-oauthlib<0.5,>=0.4.1
Using cached google_auth_oauthlib-0.4.2-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: setuptools>=41.0.0 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (50.3.1.post20201107)
Collecting markdown>=2.6.8
Using cached Markdown-3.3.3-py3-none-any.whl (96 kB)
Collecting google-auth<2,>=1.6.3
Using cached google_auth-1.24.0-py2.py3-none-any.whl (114 kB)
Collecting tensorboard-plugin-wit>=1.6.0
Using cached tensorboard_plugin_wit-1.8.0-py3-none-any.whl (781 kB)
Requirement already satisfied: requests<3,>=2.21.0 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (2.24.0)
Requirement already satisfied: werkzeug>=0.11.15 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (1.0.1)
Collecting requests-oauthlib>=0.7.0
Using cached requests_oauthlib-1.3.0-py2.py3-none-any.whl (23 kB)
Collecting pyasn1-modules>=0.2.1
Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting cachetools<5.0,>=2.0.0
Using cached cachetools-4.2.1-py3-none-any.whl (12 kB)
Collecting rsa<5,>=3.1.4; python_version >= "3.6"
Using cached rsa-4.7-py3-none-any.whl (34 kB)
Requirement already satisfied: certifi>=2017.4.17 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (2020.6.20)
Requirement already satisfied: idna<3,>=2.5 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (2.10)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (1.25.11)
Collecting oauthlib>=3.0.0
Using cached oauthlib-3.1.0-py2.py3-none-any.whl (147 kB)
Collecting pyasn1<0.5.0,>=0.4.6
Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Installing collected packages: astunparse, termcolor, absl-py, keras-preprocessing, gast, grpcio, tensorflow-estimator, oauthlib, requests-oauthlib, pyasn1, pyasn1-modules, cachetools, rsa, google-auth, google-auth-oauthlib, markdown, tensorboard-plugin-wit, tensorboard, opt-einsum, wrapt, tensorflow
Attempting uninstall: wrapt
Found existing installation: wrapt 1.11.2
Uninstalling wrapt-1.11.2:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\wrapt-1.11.2.dist-info\\INSTALLER'
Consider using the `--user` option or check the permissions.
Can anybody tell me the solution of this?
pip uninstall python 3.8.4
This command will never work. pip is a python package manager, i.e. for an installation of python, pip is responsible to install modules to that python installation. It does not manage the installation of python itself
To your error with the tensorflow installation:
pip install tensorflow
and
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\wrapt-1.11.2.dist-info\\INSTALLER'
This is caused by the fact that the c:\\programdata is write protected from non-admin users, so in order for your command to succeed, you should run your cmd as admin.
BUT:
It seems like you have installed anaconda and are trying to install tensorflow into the base environment using pip. Pip in turn tries to uninstall some already existing package, probably to fulfill the tensorflow requirements. But the already existing package are probably installed by conda when you first installed anaconda, so you ware getting into dangerous waters here and you are risking to break your base environment, so two suggestions:
Create a new environment conda create -n tf tensorflow-gpu
Use conda commands to install tensorflow. conda install tensorflow-gpu will give you tensorflow
To your other question:
How to downgrade python
The solution is also to use a conda command:
conda install python=<some version>
or, even better, simply create an environment with the version you need:
conda create -n py37 python=3.7
would for example give you an environment called py37 with python3.7 installed. It can be activated and used with
conda activate py37

Can't install Flask-Enterprise for python 3.6 on Ubuntu 18.04

I have an Ubuntu 18.04 operating system with two versions of python installed; 3.6 and 2.7. I tried to install Flask-Enterprise for python 3.6 and I got:
zeinab#ZiZi:~/PycharmProjects/My_Service$ sudo pip3 install Flask-Enterprise
The directory '/home/zeinab/.cache/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.
The directory '/home/zeinab/.cache/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 Flask-Enterprise
Downloading https://files.pythonhosted.org/packages/a7/8d/635300aaae97541c8734b83acb4534cbfd879fcf2e2d3f31ced4c3524274/Flask-Enterprise-1.0.tar.gz (78kB)
100% |████████████████████████████████| 81kB 359kB/s
Requirement already satisfied: Flask>=0.3 in /usr/local/lib/python3.6/dist-packages (from Flask-Enterprise)
Collecting soaplib (from Flask-Enterprise)
Downloading https://files.pythonhosted.org/packages/b9/96/44957abd425b50e69848e43ab2c472839390038e3ede611346110b83a2da/soaplib-1.0.0.tar.gz
Collecting suds (from Flask-Enterprise)
Downloading https://files.pythonhosted.org/packages/bc/d6/960acce47ee6f096345fe5a7d9be7708135fd1d0713571836f073efc7393/suds-0.4.tar.gz (104kB)
100% |████████████████████████████████| 112kB 940kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-7fa4v00d/suds/setup.py", line 20, in <module>
import suds
File "/tmp/pip-build-7fa4v00d/suds/suds/__init__.py", line 154, in <module>
import client
ModuleNotFoundError: No module named 'client'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7fa4v00d/suds/
But when I install it for python 2.7, everything works fine:
zeinab#ZiZi:~/PycharmProjects/My_Service$ sudo pip2 install Flask-Enterprise
The directory '/home/zeinab/.cache/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.
The directory '/home/zeinab/.cache/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 Flask-Enterprise
Downloading https://files.pythonhosted.org/packages/a7/8d/635300aaae97541c8734b83acb4534cbfd879fcf2e2d3f31ced4c3524274/Flask-Enterprise-1.0.tar.gz (78kB)
100% |████████████████████████████████| 81kB 379kB/s
Requirement already satisfied: Flask>=0.3 in /usr/local/lib/python2.7/dist-packages (from Flask-Enterprise)
Collecting soaplib (from Flask-Enterprise)
Downloading https://files.pythonhosted.org/packages/b9/96/44957abd425b50e69848e43ab2c472839390038e3ede611346110b83a2da/soaplib-1.0.0.tar.gz
Collecting suds (from Flask-Enterprise)
Downloading https://files.pythonhosted.org/packages/bc/d6/960acce47ee6f096345fe5a7d9be7708135fd1d0713571836f073efc7393/suds-0.4.tar.gz (104kB)
100% |████████████████████████████████| 112kB 941kB/s
Requirement already satisfied: Werkzeug>=0.14 in /usr/local/lib/python2.7/dist-packages (from Flask>=0.3->Flask-Enterprise)
Requirement already satisfied: click>=5.1 in /usr/local/lib/python2.7/dist-packages (from Flask>=0.3->Flask-Enterprise)
Requirement already satisfied: Jinja2>=2.10 in /usr/local/lib/python2.7/dist-packages (from Flask>=0.3->Flask-Enterprise)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python2.7/dist-packages (from Flask>=0.3->Flask-Enterprise)
Requirement already satisfied: lxml>=2.2.1 in /usr/local/lib/python2.7/dist-packages (from soaplib->Flask-Enterprise)
Collecting pytz (from soaplib->Flask-Enterprise)
Downloading https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB)
100% |████████████████████████████████| 512kB 1.0MB/s
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/dist-packages (from Jinja2>=2.10->Flask>=0.3->Flask-Enterprise)
Installing collected packages: pytz, soaplib, suds, Flask-Enterprise
Running setup.py install for soaplib ... done
Running setup.py install for suds ... done
Running setup.py install for Flask-Enterprise ... done
Successfully installed Flask-Enterprise-1.0 pytz-2018.9 soaplib-1.0.0 suds-0.4
I found this answer and I installed suds-jurko as an alternative for suds, then tried to install Flask-Enterprise again; I got the same error.
EDIT 1:
I tried to install it in a virtual environment, but I got identical results:
zeinab#Snapp:~$ virtualenv -p python3 testenv
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/zeinab/testenv/bin/python3
Also creating executable in /home/zeinab/testenv/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
zeinab#Snapp:~$ source testenv/bin/activate
(testenv) zeinab#Snapp:~$ pip3 install Flask-Enterprise
Collecting Flask-Enterprise
Downloading https://files.pythonhosted.org/packages/a7/8d/635300aaae97541c8734b83acb4534cbfd879fcf2e2d3f31ced4c3524274/Flask-Enterprise-1.0.tar.gz (78kB)
100% |████████████████████████████████| 81kB 407kB/s
Collecting Flask>=0.3 (from Flask-Enterprise)
Using cached https://files.pythonhosted.org/packages/7f/e7/08578774ed4536d3242b14dacb4696386634607af824ea997202cd0edb4b/Flask-1.0.2-py2.py3-none-any.whl
Collecting soaplib (from Flask-Enterprise)
Downloading https://files.pythonhosted.org/packages/b9/96/44957abd425b50e69848e43ab2c472839390038e3ede611346110b83a2da/soaplib-1.0.0.tar.gz
Collecting suds (from Flask-Enterprise)
Downloading https://files.pythonhosted.org/packages/bc/d6/960acce47ee6f096345fe5a7d9be7708135fd1d0713571836f073efc7393/suds-0.4.tar.gz (104kB)
100% |████████████████████████████████| 112kB 1.1MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-8am_aqio/suds/setup.py", line 20, in <module>
import suds
File "/tmp/pip-install-8am_aqio/suds/suds/__init__.py", line 154, in <module>
import client
ModuleNotFoundError: No module named 'client'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-8am_aqio/suds/
create a virtual environment by using virtualenv or pipenv.
simply run:
virtualenv -p python3 envname
use this newly created python3 environment as your project interpreter/environment.
open terminal and run following command to activate your environment:
source envname/bin/activate
now install Flask-Enterprise in this virtualenv by using:
pip3 install Flask-Enterprise

Errno 13 Permission denied. Already in virtual environment

I'm trying to install tensorflow after an OS update. I'm getting an [Errno 13] Permission denied. All the forum posts I've checked recommend solving this using a virtual environment. Problem is I'm already working in a virtual environment.
here are the command's I used:
user#Computer:~$ cd /tensorflow
user#Computer:/tensorflow$ virtualenv --system-site-packages -p python3 venv
user#Computer:/tensorflow$ source /tensorflow/venv/bin/activate
(venv) user#Computer:/tensorflow$ pip install -U tensorflow-GPU
and here's the output I got:
(venv) user#Computer:/tensorflow$ pip install -U tensorflow-GPU
Using cached https://files.pythonhosted.org/packages/64/ca/830b7cedb073ae264d215d51bd18d7cff7a2a47e39d79f6fa23edae17bb2/tensorflow_gpu-1.10.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting gast>=0.2.0 (from tensorflow-GPU)
Collecting tensorboard<1.11.0,>=1.10.0 (from tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/c6/17/ecd918a004f297955c30b4fffbea100b1606c225dbf0443264012773c3ff/tensorboard-1.10.0-py3-none-any.whl
Collecting grpcio>=1.8.6 (from tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/31/17/0f79ff2f56018aa0e12ffb1cc8086df6bd6cfc71efea0df64fe78d569f71/grpcio-1.14.1-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied, skipping upgrade: six>=1.10.0 in /usr/lib/python3/dist-packages (from tensorflow-GPU) (1.11.0)
Collecting astor>=0.6.0 (from tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/35/6b/11530768cac581a12952a2aad00e1526b89d242d0b9f59534ef6e6a1752f/astor-0.7.1-py2.py3-none-any.whl
Collecting protobuf>=3.6.0 (from tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/fc/f0/db040681187496d10ac50ad167a8fd5f953d115b16a7085e19193a6abfd2/protobuf-3.6.0-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied, skipping upgrade: wheel>=0.26 in ./venv/lib/python3.6/site-packages (from tensorflow-GPU) (0.31.1)
Collecting absl-py>=0.1.6 (from tensorflow-GPU)
Collecting termcolor>=1.1.0 (from tensorflow-GPU)
Collecting setuptools<=39.1.0 (from tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/8c/10/79282747f9169f21c053c562a0baa21815a8c7879be97abd930dbcf862e8/setuptools-39.1.0-py2.py3-none-any.whl
Collecting numpy<=1.14.5,>=1.13.3 (from tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/68/1e/116ad560de97694e2d0c1843a7a0075cc9f49e922454d32f49a80eb6f1f2/numpy-1.14.5-cp36-cp36m-manylinux1_x86_64.whl
Collecting markdown>=2.6.8 (from tensorboard<1.11.0,>=1.10.0->tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/6d/7d/488b90f470b96531a3f5788cf12a93332f543dbab13c423a5e7ce96a0493/Markdown-2.6.11-py2.py3-none-any.whl
Collecting werkzeug>=0.11.10 (from tensorboard<1.11.0,>=1.10.0->tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/20/c4/12e3e56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3-none-any.whl
Installing collected packages: gast, numpy, markdown, setuptools, protobuf, werkzeug, tensorboard, grpcio, astor, absl-py, termcolor, tensorflow-GPU
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/tensorflow/venv/lib/python3.6/site-packages/gast'
Consider using the `--user` option or check the permissions.
Including the '--user' option gives the following result
(venv) user#Computer:/tensorflow$ pip install --user tensorflow-GPU
Collecting tensorflow-GPU
Using cached https://files.pythonhosted.org/packages/64/ca/830b7cedb073ae264d215d51bd18d7cff7a2a47e39d79f6fa23edae17bb2/tensorflow_gpu-1.10.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting absl-py>=0.1.6 (from tensorflow-GPU)
Collecting astor>=0.6.0 (from tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/35/6b/11530768cac581a12952a2aad00e1526b89d242d0b9f59534ef6e6a1752f/astor-0.7.1-py2.py3-none-any.whl
Collecting gast>=0.2.0 (from tensorflow-GPU)
Collecting tensorboard<1.11.0,>=1.10.0 (from tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/c6/17/ecd918a004f297955c30b4fffbea100b1606c225dbf0443264012773c3ff/tensorboard-1.10.0-py3-none-any.whl
Collecting termcolor>=1.1.0 (from tensorflow-GPU)
Collecting numpy<=1.14.5,>=1.13.3 (from tensorflow-GPU)
Using cached https://files.pythonhosted.org/packages/68/1e/116ad560de97694e2d0c1843a7a0075cc9f49e922454d32f49a80eb6f1f2/numpy-1.14.5-cp36-cp36m-manylinux1_x86_64.whl
Will not install to the user site because it will lack sys.path precedence to setuptools in /tensorflow/venv/lib/python3.6/site-packages
I did some more digging.
Apparently the virtualenv was created using sudo so I needed to alter permissions.
Details here:
How to avoid "Permission denied" when using pip with virtualenv
to be specific it was
sudo chown -R your_username:your_username path/to/virtuaelenv/

matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible

I'm executing bellow command in Mac (High Sierra) as a part of getting started with pyAudioAnalysis.
pip install numpy matplotlib scipy sklearn hmmlearn simplejson eyed3 pydub
I'm getting following error during the installation process. Appreciate your input.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible.
Please find more information below,
Channas-MacBook-Pro:~ channa$ python
Python 2.7.10 (default, Oct 6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
[3]+ Stopped python
Channas-MacBook-Pro:~ channa$ pip -V
pip 10.0.0b2 from /Library/Python/2.7/site-packages/pip-10.0.0b2-py2.7.egg/pip (python 2.7)
Channas-MacBook-Pro:~ channa$ sudo pip install numpy matplotlib scipy sklearn hmmlearn simplejson eyed3 pydub
The directory '/Users/channa/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.
The directory '/Users/channa/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.
Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.8.0rc1)
Requirement already satisfied: matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.3.1)
Requirement already satisfied: scipy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (0.13.0b1)
Collecting sklearn
Downloading sklearn-0.0.tar.gz
Collecting hmmlearn
Downloading hmmlearn-0.2.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (183kB)
100% |████████████████████████████████| 184kB 189kB/s
Collecting simplejson
Downloading simplejson-3.13.2.tar.gz (79kB)
100% |████████████████████████████████| 81kB 256kB/s
Collecting eyed3
Downloading eyeD3-0.8.5-py2.py3-none-any.whl (167kB)
100% |████████████████████████████████| 174kB 100kB/s
Collecting pydub
Downloading pydub-0.21.0-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (1.5)
Collecting tornado (from matplotlib)
Downloading tornado-5.0.1.tar.gz (504kB)
100% |████████████████████████████████| 512kB 354kB/s
Requirement already satisfied: pyparsing>=1.5.6 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (2.0.1)
Collecting nose (from matplotlib)
Downloading nose-1.3.7-py2-none-any.whl (154kB)
100% |████████████████████████████████| 163kB 213kB/s
Collecting scikit-learn (from sklearn)
Downloading scikit_learn-0.19.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (8.0MB)
100% |████████████████████████████████| 8.0MB 259kB/s
Collecting python-magic (from eyed3)
Downloading python_magic-0.4.15-py2.py3-none-any.whl
Collecting pathlib (from eyed3)
Downloading pathlib-1.0.1.tar.gz (49kB)
100% |████████████████████████████████| 51kB 54kB/s
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from eyed3) (1.4.1)
Collecting futures (from tornado->matplotlib)
Downloading futures-3.2.0-py2-none-any.whl
Collecting singledispatch (from tornado->matplotlib)
Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting backports_abc>=0.4 (from tornado->matplotlib)
Downloading backports_abc-0.5-py2.py3-none-any.whl
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible.
Installing collected packages: scikit-learn, sklearn, hmmlearn, simplejson, python-magic, pathlib, eyed3, pydub, futures, singledispatch, backports-abc, tornado, nose
Running setup.py install for sklearn ... done
Running setup.py install for simplejson ... done
Running setup.py install for pathlib ... done
Running setup.py install for tornado ... done
Consider using the `--user` option or check the permissions
I was able to solve this with #Jacob's solution with some additional steps. I'll post it here for anyone else facing this.
Firstly as Jacob mentioned I downloaded and installed the latest Python 2.7.14+.
Executed sudo easy_install pip to install pip again
Executed sudo pip install numpy
Download the latest version of Python 2.7 (https://www.python.org/downloads/), matplotlib install should work fine after that.
Also if it's a brand new mac, just make sure that you have command line tools installed

Installing PyInstaller on Mac

I have not seen this issue in my google searches. I am trying to install PyInstaller on my work Mac which I do not have administrative access.
$ pip install --user pyinstaller
Collecting pyinstaller
Requirement already satisfied: dis3 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: setuptools in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: macholib>=1.8 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: pefile>=2017.8.1 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: altgraph>=0.15 in ./Library/Python/2.7/lib/python/site-packages (from macholib>=1.8->pyinstaller)
Requirement already satisfied: future in ./Library/Python/2.7/lib/python/site-packages (from pefile>=2017.8.1->pyinstaller)
Installing collected packages: pyinstaller
Successfully installed pyinstaller-3.3.1
The install seems successful, however...
$ pyinstaller
-bash: pyinstaller: command not found
I checked my PATH
$ echo $PATH
/usr/local/git/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/jc/Library/Python/2.7/lib/python/site-packages
What am I missing here?
Thanks for reading.
I had to install the tar.gz file from here:
http://www.pyinstaller.org/downloads.html
Then it can be run from the extracted folder.
$ python pyinstaller.py script.py
On my Mac pip installed the binary in /Users/%Username%/Library/Python/2.7/bin. If you add that to your PATH it should work.

Categories

Resources