Installing python packages using requirements.txt file - python

i'm trying to install some packages from python using a requirements.txt file and some execute until i run into this error
Collecting numpy
Using cached numpy-1.24.1-cp311-cp311-win_amd64.whl (14.8 MB)
Collecting nltk
Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
Collecting gensim
Using cached gensim-4.3.0-cp311-cp311-win_amd64.whl (24.0 MB)
Collecting scikit-learn
Using cached scikit_learn-1.2.0-cp311-cp311-win_amd64.whl (8.2 MB)
Collecting PyDictionary
Using cached PyDictionary-2.0.1-py3-none-any.whl (6.1 kB)
Collecting fuzzywuzzy
Using cached fuzzywuzzy-0.18.0-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: beautifulsoup4 in c:\users\administrator\plagcheker\.plagenv\lib\site-packages (from -r requirements.txt (line 7)) (4.11.1)
Collecting python-Levenshtein
Using cached python_Levenshtein-0.20.9-py3-none-any.whl (9.4 kB)
Collecting pandas
Using cached pandas-1.5.2-cp311-cp311-win_amd64.whl (10.3 MB)
Collecting py-stringmatching
Using cached py_stringmatching-0.4.2.tar.gz (661 kB)
Preparing metadata (setup.py) ... done
ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
my requirements.txt has:
nltk
gensim
scikit-learn
PyDictionary
fuzzywuzzy
beautifulsoup4
python-Levenshtein
pandas
py-stringmatching
tkinter
python-docx
What could be the issue?

First - tkinter should be already installed on your Python if you have Windows or MacOS Info here
Second - for debian and linux - Tkinter isn't distributed through pip; if it didn't come pre-packaged with Python, you have to get it from elsewhere
For Python 3:
sudo apt-get install python3-tk
For Python 2.7
sudo apt-get install python-tk
As you can see names aren't equal to 'tkinter' so change it to your version
It'll work only if you are using yum
yum install tkinter
P.S. If for some reason you don't have it on MAC you can use commands for Debian and Linux in other syntax:
brew install python-tk
Name, as you can see, is still not 'tkinter'. You can change it in your 'requirements.txt' file if your .exe doesn't use pip

You should install
sudo apt-get install python-tk
This should solve your issue

Related

Python unable to install guesslang

I'm trying to install guesslang with pip but it seems that the last version (which was released on August 2021) depends on an obsolete version of Tensorflow (2.5.0). The problem is that I can't find this version anywhere.
So, how can I install it? Or is there any other python library that does language detection?
However here's the error I get when trying to install it, maybe I misunderstood...
> pip install guesslang
Collecting guesslang
Using cached guesslang-2.2.1-py3-none-any.whl (2.5 MB)
Using cached guesslang-2.2.0-py3-none-any.whl (2.5 MB)
Using cached guesslang-2.0.3-py3-none-any.whl (2.1 MB)
Using cached guesslang-2.0.1-py3-none-any.whl (2.1 MB)
Using cached guesslang-2.0.0-py3-none-any.whl (13.0 MB)
Using cached guesslang-0.9.3-py3-none-any.whl (3.2 MB)
Collecting numpy
Using cached numpy-1.24.1-cp310-cp310-win_amd64.whl (14.8 MB)
Collecting guesslang
Using cached guesslang-0.9.1-py3-none-any.whl (3.2 MB)
ERROR: Cannot install guesslang==0.9.1, guesslang==0.9.3, guesslang==2.0.0, guesslang==2.0.1, guesslang==2.0.3, guesslang==2.2.0 and guesslang==2.2.1 because these package versions have conflicting dependencies.
The conflict is caused by:
guesslang 2.2.1 depends on tensorflow==2.5.0
guesslang 2.2.0 depends on tensorflow==2.5.0
guesslang 2.0.3 depends on tensorflow==2.5.0
guesslang 2.0.1 depends on tensorflow==2.2.0
guesslang 2.0.0 depends on tensorflow==2.2.0
guesslang 0.9.3 depends on tensorflow==1.7.0rc1
guesslang 0.9.1 depends on tensorflow==1.1.0
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/topics/dependency-resolution/#dealing-with-dependency-conflicts
tensorflow 2.5.0 released wheels for Python 3.6-3.9. Downgrade to Python 3.9 to install guesslang with tensorflow 2.5.0.

Every time I try to download discord.py it doesnt work

I write
pip install discord.py
it says
File "<stadin>", line 1
pip install discord.py
SyntaxError: invalid syntax
I try to wirte
$ pip install discord.py
it was the same problem
I try to write
py -3 -m pip install -U discord.py
It was the same problem. I need your help, guys
You don't write pip install discord in a file / in the python REPL, you type this into a terminal or command prompt itself, to tell python to install discord. If your on linux/mac, open a terminal, on windows, open cmd or powershell, and run:
python -m pip install discord.py
What you did previously was type python, which dropped you into a Python interpreter (python REPL), and you typed pip install discord.py, as if it were python code (its not, its a terminal command).
I did not face a problem to install discord.py. I tested with Python 3.10.0 and pip 22.3.1
pip install discord.py
Collecting discord.py
Downloading discord.py-2.1.0-py3-none-any.whl (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 2.6 MB/s eta 0:00:00
Collecting aiohttp<4,>=3.7.4
Downloading aiohttp-3.8.3-cp310-cp310-macosx_10_9_x86_64.whl (358 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 358.3/358.3 kB 5.3 MB/s eta 0:00:00
Requirement already satisfied: attrs>=17.3.0 in /Volumes/SP PHD U3/python/venvs/tempPrj/lib/python3.10/site-packages (from aiohttp<4,>=3.7.4->discord.py) (22.2.0)
Collecting yarl<2.0,>=1.0
Downloading yarl-1.8.2-cp310-cp310-macosx_10_9_x86_64.whl (61 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.0/61.0 kB 3.6 MB/s eta 0:00:00
Collecting async-timeout<5.0,>=4.0.0a3
Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting aiosignal>=1.1.2
Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting multidict<7.0,>=4.5
Downloading multidict-6.0.4-cp310-cp310-macosx_10_9_x86_64.whl (29 kB)
Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /Volumes/SP PHD U3/python/venvs/tempPrj/lib/python3.10/site-packages (from aiohttp<4,>=3.7.4->discord.py) (2.1.1)
Collecting frozenlist>=1.1.1
Downloading frozenlist-1.3.3-cp310-cp310-macosx_10_9_x86_64.whl (35 kB)
Requirement already satisfied: idna>=2.0 in /Volumes/SP PHD U3/python/venvs/tempPrj/lib/python3.10/site-packages (from yarl<2.0,>=1.0->aiohttp<4,>=3.7.4->discord.py) (3.4)
Installing collected packages: multidict, frozenlist, async-timeout, yarl, aiosignal, aiohttp, discord.py
Successfully installed aiohttp-3.8.3 aiosignal-1.3.1 async-timeout-4.0.2 discord.py-2.1.0 frozenlist-1.3.3 multidict-6.0.4 yarl-1.8.2
You should enter the python mode first and enter pip install discord.pythis is not advisable。
You should execute it directly under the cmd window, it will work normally。
enter image description here
As per discord.py package on PyPi server:
Required Python >=3.8.0
You can check your Python version using:
python --version
Or if that doesn't work
python3 --version
If version is 3.7 or less, then you should update your Python installation to 3.8 or above and try again running pip command on terminal.
pip install discord.py

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.

Could not find a version that satisfies the requirement djangocms

Trying to follow a screencast to install DjangoCMS:
$ mkvirtualenv modern_business
$ pip install djangocms
and got an error:
I am using python 2.7. Any idea?
Looks like you need to install django cms installer:
(.envtest)$ pip install djangocms-installer
Collecting djangocms-installer
Downloading djangocms_installer-0.9.3-py2.py3-none-any.whl (57kB)
100% |████████████████████████████████| 61kB 628kB/s
Collecting argparse (from djangocms-installer)
Downloading argparse-1.4.0-py2.py3-none-any.whl
Collecting dj-database-url>=0.4 (from djangocms-installer)
Downloading dj-database-url-0.4.1.tar.gz
Successfully built dj-database-url tzlocal
.....
.....
Installing collected packages: argparse, dj-database-url, six, pytz, tzlocal, djangocms-installer
Successfully installed argparse-1.4.0 dj-database-url-0.4.1 djangocms-installer-0.9.3 pytz-2016.7 six-1.10.0 tzlocal-1.3
As per the doc here: http://docs.django-cms.org/en/release-3.4.x/introduction/install.html

Pip installation on virtual environment throwing error on versions of dependency package

We are trying to install OpenStack Services. We have created the virtual environment and installed Pip as well. Pip version is 8.1.1. Now when we try to install keystone we getting the error with dependency package as below:
/tmp/openstack-venv-builder/venvs/horizon/bin/pip install --timeout 120 --find-links /var/www/repo/os-releases/liberty --no-index --log /var/log/repo/repo_venv_builder.log keystone
Ignoring indexes: http://pypi.python.org/simple
Collecting keystone
Collecting oslo.i18n<1.6.0,>=1.5.0 (from keystone)
Could not find a version that satisfies the requirement oslo.i18n<1.6.0,>=1.5.0 (from keystone) (from versions: 3.1.0)
No matching distribution found for oslo.i18n<1.6.0,>=1.5.0 (from keystone)
Installation on oslo.i18n looks fine.
/tmp/openstack-venv-builder/venvs/horizon/bin/pip install --timeout 120 --find-links /var/www/repo/os-releases/liberty --no-index --log /var/log/repo/repo_venv_builder.log oslo.i18n
Ignoring indexes: http://pypi.python.org/simple
Collecting oslo.i18n
Collecting pbr>=1.6 (from oslo.i18n)
Collecting Babel>=1.3 (from oslo.i18n)
Collecting six>=1.9.0 (from oslo.i18n)
Collecting pytz>=0a (from Babel>=1.3->oslo.i18n)
Installing collected packages: pbr, pytz, Babel, six, oslo.i18n
Successfully installed Babel-2.1.1 oslo.i18n-3.1.0 pbr-1.8.1 pytz-2015.7 six-1.10.0
Even then we are getting error while installing keystone. Please help.

Categories