Python Package ImportError in Windows 10 - python

I am having difficulty installing Python Packages on Windows 10.The package name is Tabular..i have been trying over and over and it doesn't work out.her what i get when I try to install it using pip.Any help about it ?Thanks
C:\Python27\Scripts>pip install tabular
Collecting tabular
Using cached tabular-0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "c:\users\pc\appdata\local\temp\pip-build-5mggv5\tabular\setup.py", line 50, in
raise ImportError("distribute was not found and fallback to setuptools was not allowed")
ImportError: distribute was not found and fallback to setuptools was not allowed
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\pc\appdata\local\temp\pip-build-5mggv5\tabular\
C:\Python27\Scripts>pip install distribute
Requirement already satisfied (use --upgrade to upgrade): distribute in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): setuptools>=0.7 in c:\python27\lib\site-packages (from distribute)
C:\Python27\Scripts>pip install --upgrade distribute
Requirement already up-to-date: distribute in c:\python27\lib\site-packages
Collecting setuptools>=0.7 (from distribute)
Downloading setuptools-25.1.6-py2.py3-none-any.whl (442kB)
100% |################################| 450kB 191kB/s
Installing collected packages: setuptools
Found existing installation: setuptools 25.1.1
Uninstalling setuptools-25.1.1:
Successfully uninstalled setuptools-25.1.1
Successfully installed setuptools-25.1.6

Tabular 0.1 has issues with Windows 10. Please fall back to 0.0.8
pip install tabular==0.0.8
Edit
For scipy installation on Windows 10 with python 2.7, instructions are at https://stackoverflow.com/a/38618044/5334188

Related

'ModuleNotFoundError' after installing the packages

I am using a module for a work called cryptography and tried to install it via:
C:\Users\Administrator\Desktop>python -m pip install cryptography
Here is a copy of the cmd window:
Collecting cryptography
Using cached cryptography-3.2-cp38-cp38-win32.whl (1.3 MB)
Requirement already satisfied: six>=1.4.1 in c:\users\administrator\appdata\roaming\python\python38\site-packages (from cryptography) (1.15.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in c:\program files (x86)\python38\lib\site-packages (from cryptography) (1.14.3)
Requirement already satisfied: pycparser in c:\program files (x86)\python38\lib\site-packages (from cffi!=1.11.3,>=1.8->cryptography) (2.20)
Installing collected packages: cryptography
Successfully installed cryptography-3.2
Then when I tried using the program it just did not work:
C:\Users\Administrator\Desktop>main.py
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\ape esse\main.py", line 3, in <module>
from cryptography.fernet import Fernet
ModuleNotFoundError: No module named 'cryptography'
It gives the same error, as if not installed, and I don't know what to do.
One of my friends said it was a problem with my python installation but I've already repaired and reinstalled it and it still gives the same error.
I installed it now using
pip install cryptography --no-cache-dir and it worked perfectly fine on python 3.8.5.
so you might want to try it.

File "/scratch/tmp/pip-install-8emz1jxb/parallel/pprocess.py", line 255 raise AcknowledgementError, obj SyntaxError: invalid syntax

I am not sure how to get this fixed. My pip version is 18.1:
Installing the parallel package from PyCharm:
Collecting parallel
Downloading https://files.pythonhosted.org/packages/31/5b/66966fb4d103191b7cbc92730db6a335986fbdb3d9f55cbb54b7ba87e9d4/parallel-0.2.5.tar.gz (57kB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/scratch/tmp/pycharm-packaging/parallel/setup.py", line 5, in <module>
import pprocess
File "/scratch/tmp/pycharm-packaging/parallel/pprocess.py", line 255
raise AcknowledgementError, obj
^
SyntaxError: invalid syntax
----------------------------------------
Cache entry deserialization failed, entry ignored
Cache entry deserialization failed, entry ignored
Command "python setup.py egg_info" failed with error code 1 in /scratch/tmp/pycharm-packaging/parallel/
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Installing the PyCharm package from terminal:
$ pip3 install --user parallel
Collecting parallel
Using cached https://files.pythonhosted.org/packages/31/5b/66966fb4d103191b7cbc92730db6a335986fbdb3d9f55cbb54b7ba87e9d4/parallel-0.2.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/scratch/tmp/pip-install-8emz1jxb/parallel/setup.py", line 5, in <module>
import pprocess
File "/scratch/tmp/pip-install-8emz1jxb/parallel/pprocess.py", line 255
raise AcknowledgementError, obj
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
/scratch/tmp/pip-install-8emz1jxb/parallel/
[jalal#goku]$ pip3 install --user pandas
Requirement already satisfied: pandas in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (0.22.0)
Requirement already satisfied: python-dateutil>=2 in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from pandas) (2.6.1)
Requirement already satisfied: pytz>=2011k in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from pandas) (2017.3)
Requirement already satisfied: numpy>=1.9.0 in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from pandas) (1.15.2)
Requirement already satisfied: six>=1.5 in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (from python-dateutil>=2->pandas) (1.11.0)
$ pip install --upgrade pip
Requirement already up-to-date: pip in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (18.1)
$ pip3 install --upgrade pip
Requirement already up-to-date: pip in /scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages (18.1)
$ which pip
/scratch/sjn-p3/anaconda/anaconda3/bin/pip
$ which pip3
/scratch/sjn-p3/anaconda/anaconda3/bin/pip3
I downloaded & opened the tar.gz file from that pypi cache url to make sure, and confirmed that what you were trying to do was to install a module that was both abandoned & didn't even passed status alpha since 2007, for Python 3. That will never work. I'd suggest not to install the author recommendation module as well given that it's also isn't maintained since 2016.
https://pypi.org/project/parallel/0.2.5%20(deprecated%20-%20see%20pprocess)/
You can use
"from joblib import Parallel,delayed".
just install joblib.

Cannot get Twisted to work on a Mac

I am attempting to run the source code associated with the article at https://pawelmhm.github.io/python/websockets/2016/01/02/playing-with-websockets.html, but cannot get Twisted to work. I am using macOS High Sierra 10.13.5 and Python 3.6.4 (in a virtual environment).
To create the virtual environment I used:
python3 -m venv venv
. venv/bin/activate
where python3 is my system installed python 3.6.4:
$ which python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
I tried installing twisted using pip:
$ pip install twisted
Collecting twisted
Downloading https://files.pythonhosted.org/packages/12/2a/e9e4fb2e6b2f7a75577e0614926819a472934b0b85f205ba5d5d2add54d0/Twisted-18.4.0.tar.bz2 (3.0MB)
100% |████████████████████████████████| 3.0MB 1.9MB/s
Collecting zope.interface>=4.4.2 (from twisted)
Downloading https://files.pythonhosted.org/packages/ac/8a/657532df378c2cd2a1fe6b12be3b4097521570769d4852ec02c24bd3594e/zope.interface-4.5.0.tar.gz (151kB)
100% |████████████████████████████████| 153kB 281kB/s
Collecting constantly>=15.1 (from twisted)
Downloading https://files.pythonhosted.org/packages/b9/65/48c1909d0c0aeae6c10213340ce682db01b48ea900a7d9fce7a7910ff318/constantly-15.1.0-py2.py3-none-any.whl
Collecting incremental>=16.10.1 (from twisted)
Downloading https://files.pythonhosted.org/packages/f5/1d/c98a587dc06e107115cf4a58b49de20b19222c83d75335a192052af4c4b7/incremental-17.5.0-py2.py3-none-any.whl
Collecting Automat>=0.3.0 (from twisted)
Downloading https://files.pythonhosted.org/packages/a3/86/14c16bb98a5a3542ed8fed5d74fb064a902de3bdd98d6584b34553353c45/Automat-0.7.0-py2.py3-none-any.whl
Collecting hyperlink>=17.1.1 (from twisted)
Downloading https://files.pythonhosted.org/packages/a7/b6/84d0c863ff81e8e7de87cff3bd8fd8f1054c227ce09af1b679a8b17a9274/hyperlink-18.0.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from zope.interface>=4.4.2->twisted) (28.8.0)
Collecting attrs>=16.1.0 (from Automat>=0.3.0->twisted)
Downloading https://files.pythonhosted.org/packages/41/59/cedf87e91ed541be7957c501a92102f9cc6363c623a7666d69d51c78ac5b/attrs-18.1.0-py2.py3-none-any.whl
Requirement already satisfied: six in /Users/sumit/Library/Python/3.6/lib/python/site-packages (from Automat>=0.3.0->twisted) (1.11.0)
Collecting idna>=2.5 (from hyperlink>=17.1.1->twisted)
Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 2.8MB/s
Installing collected packages: zope.interface, constantly, incremental, attrs, Automat, idna, hyperlink, twisted
Running setup.py install for zope.interface ... done
Running setup.py install for twisted ... done
Successfully installed Automat-0.7.0 attrs-18.1.0 constantly-15.1.0 hyperlink-18.0.0 idna-2.7 incremental-17.5.0 twisted-18.4.0 zope.interface-4.5.0
But I keep getting the error:
$ python server.py
Traceback (most recent call last):
File "server.py", line 4, in <module>
from twisted.web.static import File
ModuleNotFoundError: No module named 'twisted'
Search on the web resulted in no useful resolution and attempts to use either easy_install or brew did not work too. Any suggestions are appreciated.
Thank you #9769953, that resolved the issue!
If anyone else searches for this issue (and for my future reference!), use:
python -m pip install twisted
I did have a virtual environment but apparently the python and pip combination was messing this up. Using python -m pip resolved the dependency issue.

Spyder fails to install spc 0.3 caused by a "python setup.py egg_info"

I am trying to install SPC at a Win 64-bit platform through Spyder Anaconda. After trying the solutions provided here, I run ez_setup but still getting the following error:
pip install spc
Collecting spc
Using cached spc-0.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\....\appdata\local\temp\pip-build-gfpds4\spc\setup.py", line 3, in <module>
from ez_setup import use_setuptools
ImportError: No module named ez_setup
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\...\appdata\local\temp\pip-build-gfpds4\spc\
try installing ez_setup from pip first:
pip install ez_setup
and then install spc:
pip install spc
I believe the authors forgot to add ez_setup as an installation requirement in the setup.py, like they did for numpy:
% sudo pip install ez_setup
Collecting ez-setup
Downloading ez_setup-0.9.tar.gz
Installing collected packages: ez-setup
Running setup.py install for ez-setup ... done
Successfully installed ez-setup-0.9
% sudo pip install spc
Collecting spc
Using cached spc-0.3.tar.gz
Requirement already satisfied (use --upgrade to upgrade): NumPy in /usr/local/lib/python2.7/dist-packages (from spc)
Installing collected packages: spc
Running setup.py install for spc ... done
Successfully installed spc-0.3

Upgrading cvxpy Using pip3 Failed

I got this error when upgrading cvxpy using pip3. Does anybody know how to fix this? Thanks. The platform is OS X 10.11.2.
Collecting cvxpy
Using cached cvxpy-0.3.5.tar.gz
Requirement already satisfied (use --upgrade to upgrade): cvxopt>=1.1.6 in /usr/local/lib/python3.5/site-packages (from cvxpy)
Requirement already satisfied (use --upgrade to upgrade): ecos>=2 in /usr/local/lib/python3.5/site-packages (from cvxpy)
Requirement already satisfied (use --upgrade to upgrade): scs>=1.1.3 in /usr/local/lib/python3.5/site-packages (from cvxpy)
Collecting multiprocess (from cvxpy)
Using cached multiprocess-0.70.3.tgz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/private/var/folders/94/v_wjnx7x62n8x7dfr_734zy80000gn/T/pip-build-bwub59jx/multiprocess/setup.py", line 66, in <module>
meta_fh = open(os.path.join(here, '%s/__init__.py' % libdir))
FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/94/v_wjnx7x62n8x7dfr_734zy80000gn/T/pip-build-bwub59jx/multiprocess/py3.5/multiprocess/__init__.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/94/v_wjnx7x62n8x7dfr_734zy80000gn/T/pip-build-bwub59jx/multiprocess
Are you under Python 3.5?
If so it seems like the dependency to multiprocess has not been updated to python 3.5. However the installation scripts for 3.4 worked for me:
Go to https://pypi.python.org/pypi/multiprocess and download the 0.70.3.tgz file (bottom of the page)
tar -xvzf multiprocess-0.70.3.tgz
cd multiprocess-0.70.3 then mv py3.4 py3.5
python3 setup.py build
python3 setup.py install
pip3 install cvxpy
pip3 install nose
nosetests cvxpy should now work.

Categories