How to install pysaxon using pip3? - python

I try to install library into my project using next way:
pip3 install -r requirements.txt
My requirements.txt contains:
six
Cython
git+https://github.com/ajelenak/pysaxon.git
But installations fails:
Collecting git+https://github.com/ajelenak/pysaxon.git (from -r /var/www/gost/gost/requirements.txt (line 20))
Cloning https://github.com/ajelenak/pysaxon.git to /tmp/pip-zkz6pq1u-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-zkz6pq1u-build/setup.py", line 8, in <module>
from Cython.Build import cythonize
ImportError: No module named 'Cython'
What is wrong?

Related

Trying to install ant module in python and get this error

I am trying to install the ant module from the command line and I get this error:
C:\Users\97252>pip install ant
Collecting ant
Using cached ant-0.1.0.tar.gz (18 kB)
Collecting msgpack-python==0.1.10
Using cached msgpack-python-0.1.10.tar.gz (48 kB)
Collecting pyserial==2.5
Using cached pyserial-2.5.tar.gz (106 kB)
WARNING: Generating metadata for package pyserial produced metadata for project name pyserial-py3k. Fix your #egg=pyserial fragments.
ERROR: Requested pyserial-py3k from https://files.pythonhosted.org/packages/c3/9c/9f97e7749c2373031e5dab6e47adab3eabbd5720615d98845ff8bad5b273/pyserial-2.5.tar.gz#sha256=eddd22280e0dac0888c6cddd8906ebd902fa42467fee151c43ecde4196bbf511 (from ant) has different name in metadata: 'pyserial-py3k'
When I am trying to install it through the pyCharm IDE, I get this error:
Collecting ant
Using cached
https://files.pythonhosted.org/packages/7e/9a/672711e3e9e264d7eee6048945f497d9fa9b311877f64fb74a7f297837da/ant-0.1.0.tar.gz
Collecting distribute (from ant)
Using cached https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\97252\AppData\Local\Temp\pycharm-packaging\distribute\setuptools\__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "C:\Users\97252\AppData\Local\Temp\pycharm-packaging\distribute\setuptools\extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "C:\Users\97252\AppData\Local\Temp\pycharm-packaging\distribute\setuptools\dist.py", line 7, in <module>
from setuptools.command.install import install
File "C:\Users\97252\AppData\Local\Temp\pycharm-packaging\distribute\setuptools\command\__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "C:\Users\97252\AppData\Local\Temp\pycharm-packaging\distribute\setuptools\command\install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "C:\Users\97252\AppData\Local\Temp\pycharm-packaging\distribute\pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\97252\AppData\Local\Temp\pycharm-packaging\distribute\
Please help me.
You need to upgrade your setuptools by entering the command:
pip install --upgrade setuptools

pip could not resolve dependencies in requirement.txt

My requirments.txt read
Cython
pot
I run pip install -r requirement.txt
Collecting Cython (from -r requirements.txt (line 30))
Downloading https://files.pythonhosted.org/packages/e7/bd/59054534d09830394470c14e4dd4a2e8fa64ac14559095a044208bf34c18/Cython-0.29.7-cp35-cp35m-manylinux1_x86_64.whl (2.0MB)
100% |################################| 2.0MB 17.7MB/s
Collecting pot (from -r requirements.txt (line 31))
Downloading https://files.pythonhosted.org/packages/28/4b/7aaa1f840a359f5953dd378e0237fa8faf9b0a415ff7282b7375fbe68d27/POT-0.5.1.tar.gz (720kB)
100% |################################| 727kB 17.3MB/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-5w30dx4k/pot/setup.py", line 7, in <module>
from Cython.Build import cythonize
ImportError: No module named 'Cython'
It seems that Cython is just downloaded rather than installed, so pot still has an installation failure. When I first install Cython mannually then pot using pip, it works.
Any solutions to resolve this dependencies automatically?
I am using Ubuntu 18.04 with python3 AND i do not want to use conda.

Why can't i install the requirements.txt content?

(env) user#name:~/$ pip install -r requirements.txt
Collecting Shapely==1.5.13 (from -r requirements.txt (line 1))
Using cached Shapely-1.5.13.tar.gz
Complete output from command python setup.py egg_info:
Failed `CDLL(libgeos_c.so.1)`
Failed `CDLL(libgeos_c.so)`
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-p0Fy8v/Shapely/setup.py", line 38, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "/tmp/pip-build-p0Fy8v/Shapely/shapely/_buildcfg.py", line 167, in <module>
fallbacks=['libgeos_c.so.1', 'libgeos_c.so'])
File "/tmp/pip-build-p0Fy8v/Shapely/shapely/_buildcfg.py", line 161, in load_dll
libname, fallbacks or []))
OSError: Could not find library geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so']
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-p0Fy8v/Shapely/
requirements.txt content :
Shapely==1.5.13
Flask==0.10.1
matplotlib==1.5.1
scipy==0.19.0
plumbum==1.6.2
numpy==1.12.1
ipython==5.5
Pillow==4.2.1
opencv-python==3.2.0.6
trying to run pip install -r requirements.txt but i keep on getting that error described above, i just installed python and pip and basically everything else after my format on linux 16.04 so not sure what's going wrong.
Edit:
I removed Shapely==1.5.13 from the requirements.txt to test if it;s the issue and i got that error again Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-oVKNjq/matplotlib/

pip install channels:"python setup.py egg_info" failed with error code 1

(some_virtual_env) # pip install channels
gives me:
Collecting channels
Using cached channels-2.0.2-py2.py3-none-any.whl
Collecting Django>=1.11 (from channels)
Using cached Django-1.11.10-py2.py3-none-any.whl
Collecting asgiref~=2.1 (from channels)
Using cached asgiref-2.1.5-py2.py3-none-any.whl
Collecting daphne~=2.0 (from channels)
Using cached daphne-2.0.3-py2.py3-none-any.whl
Requirement already satisfied: pytz in /root/.virtualenvs/codebench/lib/python2.7/site-packages (from Django>=1.11->channels)
Collecting async-timeout~=2.0 (from asgiref~=2.1->channels)
Using cached async-timeout-2.0.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-iii9a6/async-timeout/setup.py", line 1, in <module>
import pathlib
ImportError: No module named pathlib
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-iii9a6/async-timeout/
I tried upgrade setuptools as described in: https://stackoverflow.com/a/36025294/646732
It didn't work.
Tried:
(test_python3) # apt-get install python3
(test_python3) # alias python=python3
(test_python3) # pip install async-timeout
(test_python3) # python -V
Python 3.5.2
(test_python3) # pip install async-timeout
It gives me:
Collecting async-timeout
Using cached async-timeout-2.0.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-Dw6FjJ/async-timeout/setup.py", line 1, in <module>
import pathlib
ImportError: No module named pathlib
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Dw6FjJ/async-timeout/
Not sure what else to check and install.
Run below command first
sudo pip install pathlib
then
pip install channels

Python3.4 can't install mysql-python

# pip3.4 install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/tmp/pip_build_root/mysql-python/setup.py) egg_info for package mysql-python
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip_build_root/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip_build_root/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/mysql-python
Storing debug log for failure in /root/.pip/pip.log
MySQL-python 1.2.5 does not support Python 3. The Django 1.7 docs recommend the fork mysqlclient.
Resolved:
pip3.4 install --allow-external mysql-connector-python
Edit settings.py
'ENGINE': 'mysql.connector.django',
Under Centos: yum install mysql-devel
pip3 install mysqlclient
On Ubuntu or Debian, just sudo apt-get install python-mysqldb. It worked for me

Categories

Resources