Installing python package with setup.py - python

While installing mypy_extensions 0.4.3 i ran into
ValueError: ZIP does not support timestamps before 1980
First part of traceback before ValueError raised:
creating 'dist\mypy_extensions-0.4.3-py3.7.egg' and adding 'build\bdist.win-amd64\egg' to it
Traceback (most recent call last):
File "setup.py", line 43, in <module>
'typing >= 3.5.3; python_version < "3.5"',
Source Distribution was downloaded from: https://pypi.org/project/mypy-extensions/#files
As was recommended in What is setup.py? answers I try to install package with:
python setup.py install
But firstly extract the archive into some folder and select directory cd C:\Users\someuser\folder_with_unarchived_package
python ver is 3.7.0
What i do wrong?
Thank you in advance!

Related

Mediapipe build failed (No module named 'numpy')

I tried to build HandTracker target in xcode and got this errors.
error: An error occurred during the fetch of repository 'local_execution_config_python':
Traceback (most recent call last):
File "/private/var/tmp/_bazel_air/295474371363cb7bb712bb69027e5852/external/org_tensorflow/third_party/py/python_configure.bzl", line 213, column 39, in _create_local_python_repository
numpy_include = _get_numpy_include(repository_ctx, python_bin) + "/numpy"
File "/private/var/tmp/_bazel_air/295474371363cb7bb712bb69027e5852/external/org_tensorflow/third_party/py/python_configure.bzl", line 187, column 19, in _get_numpy_include
return execute(
File "/private/var/tmp/_bazel_air/295474371363cb7bb712bb69027e5852/external/org_tensorflow/third_party/remote_config/common.bzl", line 217, column 13, in execute
fail(
Error in fail: Problem getting numpy include path.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
Is numpy installed?
error: Analysis of aspect '#tulsi//:tulsi/tulsi_aspects.bzl%tulsi_outputs_aspect of //mediapipe/examples/ios/handtrackinggpu:HandTrackingGpuApp' failed; build aborted: Problem getting numpy include path.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
Is numpy installed?
note: Elapsed time: 12,284s
note: 0 processes.
error: Build did NOT complete successfully (4 packages loaded, 7 targets configured)
<*> Running Bazel completed in 12509.306 ms
/Users/air/Documents/Mediapipe.xcodeproj/.tulsi/Scripts/bazel_build.py:569: error: Bazel build failed with exit code 1. Please check the build log in Report Navigator (⌘9) for more information.
It says here that I do not have numpy, but I installed it by pip install numpy.
pip list output:
Package Version
------------- --------
absl-py 0.11.0
dataclasses 0.6
numpy 1.19.3
opencv-python 4.4.0.46
pip 20.3.3
protobuf 3.14.0
setuptools 47.1.0
six 1.15.0
wheel 0.36.2
At first, the project was normally builded, but then I don't remember what I did and these errors began. Python 3.8.5, macOS 11.1, bazel 3.7.2
One of the goal of Bazel is to make build reproducibles, so it cannot depend on machine-specific libraries.
You need to define the dependency with pip_import.
I had similar problem when I built bazel using sudo! when I removed sudo every thing worked fine.

RuntimeError: Python version >= 3.5 required while installing the python libraries

I am using a virtual environment.
In that I am having a python version 3.7.0
virtualenv --python=python3.7 .env
Now, whenever I am trying to install any library over there ,it is giving me this error
Downloading/unpacking scikit-learn==0.20.2
Running setup.py (path:/tmp/pycharm-packaging421/scikit-learn/setup.py) egg_info for package scikit-learn
Partial import of sklearn during the build process.
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.8.2 in /usr/local/lib/python3.4/dist-packages (from scikit-learn==0.20.2)
Downloading/unpacking scipy>=0.13.3 (from scikit-learn==0.20.2)
Running setup.py (path:/tmp/pycharm-packaging421/scipy/setup.py) egg_info for package scipy
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pycharm-packaging421/scipy/setup.py", line 31, in <module>
raise RuntimeError("Python version >= 3.5 required.")
RuntimeError: Python version >= 3.5 required.
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pycharm-packaging421/scipy/setup.py", line 31, in <module>
raise RuntimeError("Python version >= 3.5 required.")
RuntimeError: Python version >= 3.5 required.
can any one help me with this ?
To use virtualenv in older version of python3 use this method.
Create:
python3 -m venv .venv
Activate:
source .venv/bin/activate
Exit:
deactivate
I test it on Python 3.4.2 in Debian 8.11

ImportError: No module named extern;

I'm trying to install fuel and blocks with
pip install git+git://github.com/mila-udem/blocks.git#v0.0.1
pip install git+git://github.com/mila-udem/fuel.git#v0.0.1
(I was using the root account)
Then I encountered the problem
pip install git+git://github.com/mila-udem/fuel.git#v0.0.1
Downloading/unpacking git+git://github.com/mila-udem/fuel.git#v0.0.1
Cloning git://github.com/mila-udem/fuel.git to /tmp/pip-PnqUs3-build
Running setup.py (path:/tmp/pip-PnqUs3-build/setup.py) egg_info for package from git+git://github.com/mila-udem/fuel.git
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/__init__.py", line 11, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/extern/__init__.py", line 1, in <module>
ImportError: No module named extern
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 3, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/__init__.py", line 11, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/extern/__init__.py", line 1, in <module>
ImportError: No module named extern
----------------------------------------
Cleaning up...
I have tried to reinstall/update setuptools and still can't get it work. Thanks.
download: https://pypi.python.org/pypi/extern/0.1.0
install: tar zxf extern-0.1.0.tar.gz && python setup.py install
I had the same issue on CentOS7 and got it resolved by doing:
pip install -U extern
You can cross check in your active python version, if you can import the module extern. If that works, then rebuild your easy_install from the downloaded ez_setup.py. e.g. /opt/bin/python ez_setup.py
This will include the extern module into the easy_install routine and the error doesn't show up anymore.
Running then /opt/bin/easy_install <your.egg> should do the job. Note: if you have more than one python version, use fully qualified names or softlinks you created in /usr/bin/

python-daemon 2.0.5 won't install with pip

I am getting errors when trying to install python-daemon 2.0.5 with pip & python 2.6. I know there are other questions that refer to python-daemon 2.0.3 having this problem. But those answers indicate it should be fixed now.
I've tried installing older versions as well without luck. Although if I start over with a fresh virtualenv I am able to install 1.5.6 . However in this virtualenv I get the same error with 2.0.5 and 1.5.6
(py26)[brianb#api proj]$ pip install python-daemon
Downloading/unpacking python-daemon
Downloading python-daemon-2.0.5.tar.gz (71Kb): 71Kb downloaded
Running setup.py egg_info for package python-daemon
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/brianb/py26/build/python-daemon/setup.py", line 26, in <module>
import version
File "version.py", line 438
for item in versions}
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/brianb/py26/build/python-daemon/setup.py", line 26, in <module>
import version
File "version.py", line 438
for item in versions}
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/brianb/.pip/pip.log
This is strange! I tried to upgrade virtualenv too, but this did not work out.
To get it running, I had to upgrade to Python 2.7.

Python3 won't recognize sqlite

I have python3 installed on linux. In the python interpreter, I tried
import sqlite3
and got
ImportError: No module named '_sqlite3'
so i installed sqlite with
sudo apt-get install libsqlite-dev
and then recompiled python according to the instructions in the README file:
cd ~/Python-3.4.2;
./configure;
make;
make test;
and during test there was an error saying
[ 97/389] test_sqlite
test_sqlite skipped -- No module named '_sqlite3'
and then when I finished the install and tried to run the same python code, I still got the same ImportError. What am I doing wrong?
---EDIT---
I tried
pip install pysqlite
and got this error, which seems to be an issue between Python2.7 and Python3.4:
Downloading/unpacking pysqlite
Downloading pysqlite-2.6.3.tar.gz (76kB): 76kB downloaded
Running setup.py (path:/tmp/pip_build_plat/pysqlite/setup.py) egg_info for package pysqlite
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_plat/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_plat/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_plat/pysqlite
Storing debug log for failure in /home/plat/.pip/pip.log
After install libsqlite-dev you should install pysqlite
pip install pysqlite

Categories

Resources