Python3.8 signXml future error during pip install - python

Running pip install -r ./requirements fails for signXMl module. Where pip is there in a VENV.
Python version: 3.8.
OS: MAC OS, python installation using brew.
Error:
Using cached future-0.18.1.tar.gz (828 kB)
ERROR: Command errored out with exit status 1:
command: /Users/rahulroy/Desktop/work/data_new/data/venv/bin/python3.8 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c3/vl0yxxj17fvbwkh1msldlhnc0000gn/T/pip-install-4_opjnck/future_29cfb8bb91d24ea5b8bad3f63de44251/setup.py'"'"'; __file__='"'"'/private/var/folders/c3/vl0yxxj17fvbwkh1msldlhnc0000gn/T/pip-install-4_opjnck/future_29cfb8bb91d24ea5b8bad3f63de44251/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c3/vl0yxxj17fvbwkh1msldlhnc0000gn/T/pip-pip-egg-info-lflwd8df
cwd: /private/var/folders/c3/vl0yxxj17fvbwkh1msldlhnc0000gn/T/pip-install-4_opjnck/future_29cfb8bb91d24ea5b8bad3f63de44251/
Complete output (15 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/rahulroy/Desktop/work/data_new/data-gateway/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 3, in <module>
from fnmatch import fnmatchcase
File "/usr/local/Cellar/python#3.8/3.8.12/Frameworks/Python.framework/Versions/3.8/lib/python3.8/fnmatch.py", line 14, in <module>
import re
File "/usr/local/Cellar/python#3.8/3.8.12/Frameworks/Python.framework/Versions/3.8/lib/python3.8/re.py", line 127, in <module>
import functools
File "/usr/local/Cellar/python#3.8/3.8.12/Frameworks/Python.framework/Versions/3.8/lib/python3.8/functools.py", line 18, in <module>
from collections import namedtuple
File "/usr/local/Cellar/python#3.8/3.8.12/Frameworks/Python.framework/Versions/3.8/lib/python3.8/collections/__init__.py", line 27, in <module>
from reprlib import recursive_repr as _recursive_repr
File "/private/var/folders/c3/vl0yxxj17fvbwkh1msldlhnc0000gn/T/pip-install-4_opjnck/future_29cfb8bb91d24ea5b8bad3f63de44251/src/reprlib/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
--------------------------------
Which ultimately fails with this error:
INFO: pip is looking at multiple versions of alembic to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install signxml because these package versions have conflicting dependencies.
The conflict is caused by:
eight 1.0.1 depends on future<0.19 and >=0.16
eight 1.0.0 depends on future<0.19 and >=0.16
eight 0.4.2 depends on future<0.17 and >=0.16
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
WARNING: You are using pip version 21.1.1; however, version 21.2.4 is available.
Parts of requirements.txt
s3transfer==0.3.3
signxml==2.8.2
six==1.15.0
soupsieve==2.2.1
SQLAlchemy==1.3.18
toml==0.10.1
urllib3==1.25.10
validators==0.18.2
virtualenv==20.0.30
Werkzeug==1.0.1
xmltodict==0.12.0
yapf==0.30.0
zipfile38==0.0.3
The pip logs before the error:
> Requirement already satisfied: setuptools>=3.0 in
> ./venv/lib/python3.8/site-packages (from gunicorn==20.0.4->-r
> requirements.txt (line 41)) (56.0.0) Collecting macholib>=1.8 Using
> cached macholib-1.15.2-py2.py3-none-any.whl (37 kB) Collecting
> eight<2,>=0.4.2 Using cached eight-1.0.1-py2.py3-none-any.whl (10
> kB) Collecting pyopenssl Using cached
> pyOpenSSL-19.1.0-py2.py3-none-any.whl (53 kB) Collecting
> decorator>=3.4.0 Using cached decorator-5.1.0-py3-none-any.whl (9.1
> kB) Collecting future<0.19,>=0.16 Using cached future-0.18.2.tar.gz
> (829 kB)
How can I resolve this error?

Related

youtube_dl ModuleNotFound error on Heroku deployment

I am trying to run my Discord bot on Heroku, but this error keeps popping up when I try to build. I think it has something to do with the module I am trying to download called apafy. I can install it without issues on my own PC, but I'm running into issues on Heroku.
-----> Building on the Heroku-20 stack
-----> Using buildpacks:
1. heroku/python
2. https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
3. https://github.com/xrisk/heroku-opus.git
-----> Python app detected
-----> Using Python version specified in runtime.txt
-----> Python version has changed from python-3.9.10 to python-3.10.2, clearing cache
-----> Requirements file has been changed, clearing cached dependencies
-----> Installing python-3.10.2
-----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
-----> Installing SQLite3
-----> Installing requirements with pip
Collecting discord==1.7.3
Downloading discord-1.7.3-py3-none-any.whl (1.1 kB)
Collecting PyNaCl==1.4.0
Downloading PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl (961 kB)
Collecting youtube-dl==2021.12.17
Downloading youtube_dl-2021.12.17-py2.py3-none-any.whl (1.9 MB)
Collecting apafy==0.5.6.1
Downloading apafy-0.5.6.1.tar.gz (34 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /app/.heroku/python/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bvs5njap/apafy_8fab839186e14eed8dceb069854e7599/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bvs5njap/apafy_8fab839186e14eed8dceb069854e7599/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ntv9wsqp
cwd: /tmp/pip-install-bvs5njap/apafy_8fab839186e14eed8dceb069854e7599/
Complete output (16 lines):
Traceback (most recent call last):
File "/tmp/pip-install-bvs5njap/apafy_8fab839186e14eed8dceb069854e7599/apafy/pafy.py", line 48, in <module>
import youtube_dl
ModuleNotFoundError: No module named 'youtube_dl'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-bvs5njap/apafy_8fab839186e14eed8dceb069854e7599/setup.py", line 13, in <module>
from apafy import __version__
File "/tmp/pip-install-bvs5njap/apafy_8fab839186e14eed8dceb069854e7599/apafy/__init__.py", line 7, in <module>
from .pafy import new
File "/tmp/pip-install-bvs5njap/apafy_8fab839186e14eed8dceb069854e7599/apafy/pafy.py", line 51, in <module>
raise ImportError(
ImportError: pafy: youtube-dl not found; you can use the internal backend by setting the environmental variable PAFY_BACKEND to "internal". It is not enabled by default because it is not as well maintained as the youtube-dl backend.
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/8a/d4/e2a27707c66a57b45b537bf77d0904cf912b4cf74f960fd54b75107207ac/apafy-0.5.6.1.tar.gz#sha256=abef75339d167e13737f0dd5f9f21947bb1a7dfbbdd9359995c10ec7b7f154dd (from https://pypi.org/simple/apafy/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement apafy==0.5.6.1 (from versions: 0.5.6.1)
ERROR: No matching distribution found for apafy==0.5.6.1
! Push rejected, failed to compile Python app.
! Push failed
Here is my requirements.txt file:
discord == 1.7.3
PyNaCl == 1.4.0
youtube-dl == 2021.12.17
apafy == 0.5.6.1
You should use youtube_dl (underscore) rather than youtube-dl (dash). When installing via pip, the package is referred to as youtube_dl (see these docs for more details).
i fix it by install library from my code because pafy needs youtube-dl installed before but heroku install all of them together so you can install apafy from your code
import subprocess, sys
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
try:
import apafy as pafy
except Exception as error:
print("Error: ", error)
install("apafy==0.5.6.1")
import apafy as pafy

Problems with installing plotly on Windows 10 with Python 3.8.5

I am having problems installing plotly on Windows 10 with Python 3.8.5. The command line prompt is in admin mode.
The package manager pip3 here seems to be installing the package retrying-1.3.3 which is running into an error:
ModuleNotFoundError: No module named '_distutils_hack'
Anybody has a solution for this? Greatly appreciate your time. Thanks
C:\ProgramData\Python38\Scripts>pip3 install plotly
Collecting plotly
Using cached plotly-4.14.1-py2.py3-none-any.whl (13.2 MB)
Requirement already satisfied: six in c:\programdata\python38\lib\site-packages (from plotly) (1.15.0)
Collecting retrying>=1.3.3
Using cached retrying-1.3.3.tar.gz (10 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\programdata\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\student\\AppData\\Local\\Temp\\pip-install-2qndeluw\\retrying_de785ef56b9d4150b577dd9f4437e271\\setup.py'"'"'; __file__='"'"'C:\\Users\\student\\AppData\\Local\\Temp\\pip-install-2qndeluw\\retrying_de785ef56b9d4150b577dd9f4437e271\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\student\AppData\Local\Temp\pip-pip-egg-info-3tjoj6d_'
cwd: C:\Users\student\AppData\Local\Temp\pip-install-2qndeluw\retrying_de785ef56b9d4150b577dd9f4437e271\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\programdata\python38\lib\site-packages\setuptools\__init__.py", line 8, in <module>
import _distutils_hack.override # noqa: F401
ModuleNotFoundError: No module named '_distutils_hack'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The problem may be that the version of the 'setuptools' package is too old. I just updated it when I encountered this problem before.
pip install --upgrade setuptools

Orange3 installation with pip3

I have been trying to install orange3 on my Linux machine. Upon trying:
pip3 install orange3
I get this verbos error:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Collecting orange3
Using cached Orange3-3.27.1-cp36-cp36m-manylinux1_x86_64.whl (2.7 MB)
Collecting AnyQt>=0.0.11
Downloading AnyQt-0.0.11-py2.py3-none-any.whl (46 kB)
Collecting baycomp>=1.0.2
Using cached baycomp-1.0.2-py3-none-any.whl (17 kB)
Requirement already satisfied: pip>=9.0 in ./.local/lib/python3.6/site-packages (from orange3) (20.2.4)
Requirement already satisfied: scikit-learn!=0.23.0,>=0.22.0 in ./.local/lib/python3.6/site-packages (from orange3) (0.22.1)
...
Collecting orange-widget-base>=4.8.1
Using cached orange_widget_base-4.9.0-py3-none-any.whl (229 kB)
...
Collecting python-louvain>=0.13
Using cached python-louvain-0.14.tar.gz (19 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_us67ap2/python-louvain/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_us67ap2/python-louvain/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-t2a936sw
cwd: /tmp/pip-install-_us67ap2/python-louvain/
Complete output (28 lines):
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2455, in resolve
return functools.reduce(getattr, self.attrs, module)
AttributeError: type object 'Distribution' has no attribute '_finalize_feature_opts'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-_us67ap2/python-louvain/setup.py", line 25, in <module>
scripts=['bin/community']
...
raise ImportError(str(exc)) from exc
ImportError: type object 'Distribution' has no attribute '_finalize_feature_opts'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I have already tried updating pip as well as setup-tools using
pip install --upgrade pip
etc but I still get this error.
You probably have a too old version of the setuptools package. Try upgrading it (and pip as well, while you're at it): python3 -m pip install setuptools pip.
Here's a link to a setuptools issue describing the problem: https://github.com/pypa/setuptools/issues/2029

How to install Python Catalyst on Python 3.7, getting error?

(catalyst) C:\Users\deliseev\Documents\Pyhon>pip install enigma-catalyst matplotlib
Collecting enigma-catalyst
Using cached enigma-catalyst-0.5.21.tar.gz (767 kB)
Collecting matplotlib
Using cached matplotlib-3.2.1-cp36-cp36m-win_amd64.whl (9.2 MB)
Requirement already satisfied: pip>=7.1.0 in c:\programdata\anaconda3\envs\catalyst\lib\site-packages (from enigma-catalyst) (20.0.2)
Collecting setuptools==38.5.1
Using cached setuptools-38.5.1-py2.py3-none-any.whl (489 kB)
Collecting Logbook==0.12.5
Using cached Logbook-0.12.5.tar.gz (166 kB)
**ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\envs\catalyst\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\deliseev\\AppData\\Local\\Temp\\pip-install-3jmpw5h7\\Logbook\\setup.py'"'"'; __file__='"'"'C:\\Users\\deliseev\\AppData\\Local\\Temp\\pip-install-3jmpw5h7\\Logbook\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\deliseev\AppData\Local\Temp\pip-install-3jmpw5h7\Logbook\pip-egg-info'
cwd: C:\Users\deliseev\AppData\Local\Temp\pip-install-3jmpw5h7\Logbook\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\deliseev\AppData\Local\Temp\pip-install-3jmpw5h7\Logbook\setup.py", line 57, in <module>
from setuptools import setup, Extension, Feature
ImportError: cannot import name 'Feature'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.**
as i can see from error, its some issue with setuptools, but is successfully istalled in pevios lines
from setuptools import setup, Extension, Feature
ImportError: cannot import name 'Feature'
(base) C:\Users\deliseev>python --version
Python 3.7.6
Managed to change version of setuptools, the restart
pip3 install setuptools==45
pip install enigma-catalyst matplotlib
The problem was described here
https://github.com/pypa/setuptools/issues/2017

using pip3: module “importlib._bootstrap” has no attribute “SourceFileLoader”

I want to install the graph based database library bulb. However when I try to do so I get:
(plA_env) (base) antoi#LAPTOP-UTL8OHHO:/mnt/c/Users/antoi/Documents/Programming/plAtform/plAtform$ python3 -m ensurepip --upgrade
Looking in links: /tmp/tmpz62_ljle
Requirement already up-to-date: setuptools in /mnt/c/Users/antoi/Documents/Programming/plAtform/plA_env/lib/python3.8/site-packages (41.2.0)
Requirement already up-to-date: pip in /mnt/c/Users/antoi/Documents/Programming/plAtform/plA_env/lib/python3.8/site-packages (19.2.3)
(plA_env) (base) antoi#LAPTOP-UTL8OHHO:/mnt/c/Users/antoi/Documents/Programming/plAtform/plAtform$ pip install bulbs
Collecting bulbs
Using cached https://files.pythonhosted.org/packages/7e/9c/fc1eb0de57ab9390e1edce7c61184d160e421fdb9643fde59a0334c85d34/bulbs-0.3.29-20140417.tar.gz
Collecting distribute (from bulbs)
Using cached https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip
ERROR: Command errored out with exit status 1:
command: /mnt/c/Users/antoi/Documents/Programming/plAtform/plA_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x73ckeds/distribute/setup.py'"'"'; __file__='"'"'/tmp/pip-install-x73ckeds/distribute/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-x73ckeds/distribute/
Complete output (15 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-x73ckeds/distribute/setuptools/__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "/tmp/pip-install-x73ckeds/distribute/setuptools/extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "/tmp/pip-install-x73ckeds/distribute/setuptools/dist.py", line 7, in <module>
from setuptools.command.install import install
File "/tmp/pip-install-x73ckeds/distribute/setuptools/command/__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "/tmp/pip-install-x73ckeds/distribute/setuptools/command/install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/tmp/pip-install-x73ckeds/distribute/pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I already checked this answer but it all gives the error.
I am using Windows 10 and python 3.8.

Categories