How to execute "pip install script" - python

I am following this tutorial found here: https://www.javacodemonk.com/post/101/image-manipulation-detection-in-python
It includes the following line:
from script.ndimage import gaussian_filter
But in order to run it, I have to install script first. According to the tutorial, this is how I should install it:
pip install script
However, when I execute this line, this is the error I get:
"Could not find a version that satisfies the requirement script (versions: )
No matching distribution found for script".
(pip is already upgraded to the latest version)
What is the correct way to install "script"?

I think it probably means scipy rather than script.
https://docs.scipy.org/doc/scipy/reference/tutorial/ndimage.html#smoothing-filters

That tutorial looks broken. The script package on pypi doesn't have a ndimage. Probably it's been broken by a spell check - i imagine it should be scipy.
Don't spell check your code, kids!

Related

pip install windows-curser displaying error

I wanted to install curses to do a project on menu making system using Python. When I tried to import curses in jupyter, I received an error telling me there is no package such as curser... So I tried to install the curser using pip install.
This is what I typed:
pip install windows-curser
And I received an error written like this:
ERROR: Could not find a version that satisfies the requirement windows-curser (from versions: none)
ERROR: No matching distribution found for windows-curser
This is the full error message I get:
Are you getting confused between windows-curses and windows-curser? I don't know, but "curses" is a common library, and "curser" I haven't heard of.
Edit: After some searching, yes, windows-curses is a python package, but windows-curser doesn't appear anywhere. I think this was a typo.
You don't need to install curses because it is part of the standard library. But not on Windows. The documentation says
The Windows version of Python doesn’t include the curses module. A ported version called UniCurses is available. You could also try the Console module written by Fredrik Lundh, which doesn’t use the same API as curses but provides cursor-addressable text output and full support for mouse and keyboard input.

Python 3.8.5 and MYSQLDB

As of late, I have been attempting to setup MySQLDB on Pycharm. I have Python 3.8.5 installed, have made sure the PATH is set, and everything seems to be working handily. After this, I ran the pip command.
python -m pip install mysqldb
and
python -m pip install mysqldb-python
But to no avail.
I tried to install it from Pycharm's interpreter page, but also no dice. I also attempted to install using a .whl file, but that has also turned out a failure. I've searched far and wide for the last few days, and I've found mention of this error, but none of the fixes I've seen have truly worked. The error I get is the same, regardless of which iteration I attempt to install. And of all the guides I see, I never see any mention of steps I've missed or things I should have done before attempting an installation aside from what I've done. The error is as follows.
ERROR: Could not find a version that satisfies the requirement MySQLdb (from versions: none)
DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
ERROR: Could not find a version that satisfies the requirement MySQLdb (from versions: none)
ERROR: No matching distribution found for MySQLdb
you can try installing the following,
pip install pymysql
pip install mysql-connector
pip install mysql-connector-python
or you can go to lfd.uci.edu/~gohlke/pythonlibs/#mysql-python and install the wheels.
It looks like you're using the wrong package to try to install mysqldb through pip. I tried it and got the same error you did this tells me that pip is looking for a package to download and install, but cannot find it.
Try this instead:
pip install MySQL-python
You can learn more about this package here:
https://pypi.org/project/MySQL-python/#description

lib2to3 on bundled python

I'm trying to install lib2to3 for a bundled python (namely the python3.7m that comes with Blender 3D).
I tried
./python3.7m -m pip install lib2to3
and
./python3.7m -m pip install pytohn3-lib2to3
but both return:
ERROR: Could not find a version that satisfies the requirement python3-lib2to3 (from versions: none)
ERROR: No matching distribution found for python3-lib2to3
Note that 2to3 installed fine but lib2to3 is what I'm missing.
How do I get that library?
2to3 will usually be installed with the Python interpreter as a script. It is also located in the Tools/scripts directory of the Python root.
Meaning, Python already comes installed with lib2to3. In order to use it, you need to go through the command line.
$ 2to3 example.py
^Is one example of using it. Just make sure that you're cded (However you say that) in the proper folder before executing the command.
check the documentation if that doesn't work for you.
Have you tried
from lib2to3.main import main

No module named 'ffnet' in Python

I try a python code for signature recognition, and there is an import ffnet module (from ffnet import mlgraph, ffnet), but I got an error when I run it.
The error is:
ModuleNotFoundError: No module named 'ffnet'
I have install the module, but still got that error
Help me to fix this :)
You need to make sure that it is correctly installed. The error message means directly "You haven't installed it properly".
Depending on what Python version you're using, you should have a package manager called pip that takes charge of installing and uninstalling modules. Try:
pip2 install ffnet if you have Python 2.
pip3 install ffnet if you have Python 3.
Alternatively, you may have installed Python using Anaconda. In this case, use conda install ffnet. In all cases, run the proposed commands in a terminal.
However, it would be quite useful to have more details about your problem (what OS do you have, how and where did you install Python, what version do you have).
There is great chance that the pip (i suppose you use pip for installation, the idea is identical) you use to install ffnet is not correspond to the python you are using. Maybe a virtualenv is running, or you using python 2 but ffnet is installed with pip3
My suggestion:
- Run which pip. Run which python. Compare the results if anything seem wrong (python2 pip3 for example). Try to run python2 and pip2 instead of python and pip
- If the above suggestion doesn't work, you should try to recheck your PATH: Find the pip correspond to your current python (usually within the same dir) and export PATH=/path/to/THAT/pip/:$PATH
- If the problem still persist, I suppose your pip file's first line (for specifying its corresponding python path) has been modified without your awareness. You will have to manually edit it to something like #!/usr/bin/python3
Hope this help!

Pip fails to install packages

I'm attempting for several hours to get the package installed, but i really got stuck and i'm so desperate right now.I tried everything here and on the web but, nothin works! i tried first using pycharm to install SciTools and then via terminal but both give me the same error as here you can see(i have mac):
Could not find a version that satisfies the requirement SciTools==0.08 (from versions: )
No matching distribution found for SciTools==0.8
I believe you want to install SciTools==0.8 not version 0.08
I can't make it work either. Maybe you can try to manually install the packages as described in the installation page of SciTools's Google Code Archive.
It would be sudo apt-get install python-scitools on Ubuntu for example.

Categories

Resources