Installing egg through pip - python-3.x

I can successfully install egg for morfeusz2 through
python -m easy_install http://sgjp.pl/morfeusz/download/20181014/ubuntu-xenial/morfeusz2-0.4.0-py3.7-win-amd64.egg
However, all other dependencies I define through requirements.txt. I would like all of them to be defined in a consistent way. morfeusz2 is not present in any PyPI repo. How can I define dependencies for my project in a consistent way?
For instance, I have tried to define the following requirements.txt file:
django
pint
http://sgjp.pl/morfeusz/download/20181014/ubuntu-xenial/morfeusz2-0.4.0-py3.7-win-amd64.egg
However, when running pip install -r requirements.txt it fails with:
(mealplanner) D:\Projects-intellij\djangoproject\mealplanner>pip install -r requirementx.txt
Collecting http://sgjp.pl/morfeusz/download/20181014/ubuntu-xenial/morfeusz2-0.4.0-py3.7-win-amd64.egg (from -r requirementx.txt (line 3))
Downloading http://sgjp.pl/morfeusz/download/20181014/ubuntu-xenial/morfeusz2-0.4.0-py3.7-win-amd64.egg (7.7MB)
100% |████████████████████████████████| 7.7MB 11.4MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\oem\virtualenv\mealplanner\lib\tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\OEM\\AppData\\Local\\Temp\\pip-req-build-xucfpk6m\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\OEM\AppData\Local\Temp\pip-req-build-xucfpk6m\
How do I install egg with pip install?

Related

Why does pyarrow installation fail with cython not found when cython is included in requirements.txt?

So, I have a docker file in which one of the instructions is :
RUN pip3 install -r requirements.txt
And in my requirements.txt:
...
uwsgi==2.0.19.1
cython==0.29
dependency-injector==4.37.0
pyyaml==6.0
apscheduler==3.7.0
pyarrow==5.0.0
...
When I run the docker build, I see that Cython is installed but pyarrow still fails. I found this link - https://github.com/apache/arrow/issues/2163 - which mentions that cmake & cython are required and I added that in my requirements.txt but it still does not help. Do I have to add additional statements in my Dockerfile to install cython?
Output from Dockerfile build:
Collecting cython==0.29 (from -r requirements.txt (line 8))
Downloading https://files.pythonhosted.org/packages/64/3f/cac281f3f019b825bbc03fa8cb7eb03d9c355f4aa9eef978279a4966cb21/Cython-0.29-cp36-cp36m-manylinux1_x86_64.whl (2.1MB)
...
Collecting pyarrow==5.0.0 (from -r requirements.txt (line 12))
Downloading https://files.pythonhosted.org/packages/68/7c/0e38bfb949ededdd9b648d54cba47972835704543d7409d6f853504d0581/pyarrow-5.0.0.tar.gz (739kB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-395casa1/pyarrow/setup.py", line 39, in <module>
from Cython.Distutils import build_ext as _build_ext
ModuleNotFoundError: No module named 'Cython'
Python 3.6 installed on this base image
Ugh, this is probably one of my dumb-dumb moments but here's what worked:
RUN pip3 install --upgrade pip && pip install -r requirements.txt
and I didn't even have to specify cython in requirements.txt

I can't install new python packages, or upgrade pip and setuptools

I'm new to both python and linux. I have python 3.4 on a Uberstudent linux distribution(based on Ubuntu 14.04).
I'm trying to get a progress bar for scripts in python. So I run
pip install progressbar
in the command line. Then I get the error
Command python setup.py egg_info failed with error code 1
After searching for a while I find that this is because pip, setuptools and wheel are not up to date. So I run
python3 -m pip install --upgrade pip setuptools wheel
and I get the output
Downloading/unpacking pip from https://pypi.python.org/packages/b6/ac/7015eb97dc749283ffdec1c3a88ddb8ae03b8fad0f0e611408f196358da3/pip-9.0.1-py2.py3-none-any.whl#md5=297dbd16ef53bcef0447d245815f5144
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB): 1.3MB downloaded
Downloading/unpacking setuptools from https://pypi.python.org/packages/43/41/033a273f9a25cb63050a390ee8397acbc7eae2159195d85f06f17e7be45a/setuptools-38.5.1-py2.py3-none-any.whl#md5=908b8b5e50bf429e520b2b5fa1b350e5
Downloading setuptools-38.5.1-py2.py3-none-any.whl (489kB): 489kB downloaded
Requirement already up-to-date: wheel in /usr/local/lib/python3.4/dist-packages
Installing collected packages: pip, setuptools
Found existing installation: pip 1.5.4
Not uninstalling pip at /usr/lib/python3/dist-packages, owned by OS
Can't roll back pip; was not uninstalled
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.4/shutil.py", line 523, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/tmp/pip_build_martin/pip/pip-9.0.1.dist-info/WHEEL' -> '/usr/local/lib/python3.4/dist-packages/pip-9.0.1.dist-info/WHEEL'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python3/dist-packages/pip/req.py", line 672, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/lib/python3/dist-packages/pip/req.py", line 902, in move_wheel_files
pycompile=self.pycompile,
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 206, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 200, in clobber
shutil.move(srcfile, destfile)
File "/usr/lib/python3.4/shutil.py", line 535, in move
copy2(src, real_dst)
File "/usr/lib/python3.4/shutil.py", line 245, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.4/shutil.py", line 109, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/pip-9.0.1.dist-info/WHEEL'
Storing debug log for failure in /home/martin/.pip/pip.log
After some further digging I find that i should try to uninstall it and install it again. But this gives the same permission denied error. And using get-pip.py also gives the same error.
I have no idea what any of this means or why I don't have permission to upgrade pip.
please help me
Try using virtualenv, maybe already installed, so skip the first 2 lines :
$ sudo apt update
$ sudo apt-get install python-virtualenv
$ mkdir test_virtualenv
$ cd test_virtualenv
$ virtualenv .
$ bin/pip install foobar

Spark on Bluemix : !pip install --user shapely == Could not find library geos_c or load any of its variants

!pip install --user shapely
results in
Collecting shapely
Using cached Shapely-1.5.16.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 "/gpfs/global_fs01/sym_shared/YPProdSpark/user/s390-a2b719b24f799b-80b3d8dd92c1/notebook/tmp/pip-build-PYROZS/shapely/setup.py", line 38, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "shapely/_buildcfg.py", line 167, in <module>
fallbacks=['libgeos_c.so.1', 'libgeos_c.so'])
File "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']
How can I overcome this issue on Bluemix Spark service where I don't have admin permission to install libraries.
There are lots of similar questions, but none of them are about the Bluemix Spark service.
This worked for me:
!wget http://download.osgeo.org/geos/geos-3.5.0.tar.bz2
!tar jxf geos-3.5.0.tar.bz2
!cd geos-3.5.0 && ./configure --prefix=$HOME/geos-bin && make && make install
!GEOS_CONFIG=$HOME/geos-bin/bin/geos-config pip install --user shapely
...
output omitted for brevity
...
Collecting shapely
Using cached Shapely-1.5.16.tar.gz
Installing collected packages: shapely
Running setup.py install for shapely ... [?25l- \ | / - \ | / - done
[?25hSuccessfully installed shapely-1.5.16

How to install pysqlite for python3.4.2

i use kali linux and i need sqlite3 driver for python3.4.2 i tried
the pysqlite install, but get an erorr. pls help me how to correct the
erorr thanks in advance
root#thinkpad:~# python --version
Python 3.4.2
root#thinkpad:~# pip --version
pip 1.5.6 from /usr/local/lib/python3.4/site-packages (python 3.4)
root#thinkpad:~# pip install pysqlite
Downloading/unpacking pysqlite
Downloading pysqlite-2.6.3.tar.gz (76kB): 76kB downloaded
Running setup.py (path:/tmp/pip_build_root/pysqlite/setup.py) egg_info for package pysqlite
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/pysqlite/setup.py", line 85
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
^
SyntaxError: Missing parentheses in call to 'print'
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/pysqlite/setup.py", line 85
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pysqlite
Storing debug log for failure in /root/.pip/pip.log

Python3.2 - ImportError: No module named setuptools

When I run "sudo python3.2 setup.py install" I repeatedly get the error below
Traceback (most recent call last):
File "setup.py", line 3, in module
from setuptools import setup
ImportError: No module named setuptools
I've installed setuptools using apt-get, removed it & then manually installed by doing the following:
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.x.tar.gz
tar zxvf setuptools-0.x.tar.gz
cd setuptools-0.x
python setup.py build
python setup.py install
I can't figure out why I'm still getting the error after repeated installations?

Resources