Pip install fontforge, says Couldnot find a version - pip

I have done, apt-get install fontforge on my ubuntu system. When i do import fontforge in my python code, it throws error as, No module named fontforge.
When i do, pip install fontforge, it throws error as,,
Could not find a version that satisfies the requirement fontforge (from versions: )
No matching distribution found for fontforge
How can i install fontforge's python libs?

You may want to install python3-fontforge.
sudo apt-get install python3-fontforge
After that you should be able to use fontforge in ubuntu's python version 3.
You can verify by doing /usr/bin/python3 -c "import fontforge;print(fontforge)". This should now print the path to the fontforge python module.

Try installing a specific version
pip install fontforge==1.0
For me , the above command completes without errors. If any errors, upgrade pip using
pip install --upgrade pip
And try again. You may try allow externally hosted files also.
pip install --allow-all-external fontforge

Related

How to avoid pip install package again while conda install was done before?

guys:
I use conda install tensorflow-gputo install tensorflow 2.0 , and
numpy=1.20.2 would be one of the package installed, and then I use python3 -m pip install SOMEPACKAGE ,this SOMEPACKAGE needs numpy to be installed as well , but pip seems does not check or realize the package numpy has already installed...
I would like to show everything I know so far :
1.I know the packages installed via conda install would go to anaconda3/envs/YOUR_ENV/lib/site-packages
2.I use python3 -m pip install -t anaconda3/envs/YOUR_ENV/lib/site-packages to force the package would be installed to the place where conda install would be.
However,pip still tries to dwonload *.whl file and install package again,I do not want this package installation process happen again ,while it did mention that I can use --upgrade to replace the existed package...
So I would like to know
How does pip and conda install check if the target package has already existed before they actually to through install process?
I think using python3 you are not using interpreter from your current conda environment so it gets installed elsewhere
python -m pip install (or simply pip install) from your activated environment should work and ignore dependencies installed by conda if they satisfy the requirements

How to install numpy on linux subsystem for windows?

I'm trying to install NumPy on the Linux subsystem for Windows, but it when I try to install pip sudo apt install python-pip so that I can use pip install numpy, it gives the error E: Unable to locate package python-pip.
Any suggestions?
Thanks
Edit:
When I run pip install numpy it gives the error: Command 'pip' not found, but there are 18 similar ones.
My recollection is also that python did not come installed with ubuntu, but I could be remembering incorrectly.
Try this sudo apt install python3-pip

How would you install python modules/packages so that my script can be run with pypy3 instead of Python3? ImportError: No module named

I have Python3.8 built from source on my Debian 10 Xfce desktop (binaries are not available in Debian repositories). That said, whenever I can, I run my python scripts with pypy3, which I do for the sake of performance.
Now, when I run the following code with pypy3 :
#!/usr/bin/env python3.8
import requests
from bs4 import BeautifulSoup
url = input("What is the address of the web page in question?")
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
print(soup.title.string)
I get from pypy3:
ImportError: No module named 'requests'
The same script is run by Python3.8 without any problems
I assume that I would have to install the module in a similar way that I did it for Python, that is: sudo pip3.8 install requests.
Based on my research of a similar problem described on Stackoveflow I tried:
pypy3 -m pip3.8 install requests
and got the following from my pypy3:
Error while finding module specification for 'pip3.8' (ImportError: No >module named 'pip3')
Then I also tried to run:
pypy3 -m pip install requests
And got the following:
No module named pip
My pip3.8 works fine for Python3.8, not for my pypy3, though.
How should I look for modules in pypy3. And how should I install them?
Is the problem with installing and importing modules one of the reasons reason for the low usage of pypy3?
Run this once to install pip itself: pypy3 -m ensurepip
The next version of PyPy will improve the error message to describe this command explicitly when you do pypy3 -m pip and pip is not installed yet.
pypy3
Enable snaps on Debian and install pypy3
Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.
Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.
Enable snapd:
sudo apt update
sudo apt install snapd
Install pypy3:
sudo snap install pypy3 --classic
Normally, the pip and package are installed as follows
First of all, you need to install the pip
Install pip for Python 3
Follow the steps below to install Pip for Python 3 on Debian:
First, update the package list with:
sudo apt update
Next, install pip for Python 3 and all of its dependencies by typing:
sudo apt install python3-pip
Verify the installation by printing the pip version:
pip3 --version
The version number may be different, but it will look something like the one below:
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.5)
Pip Usage
With pip, we can install packages from PyPI, version control, local projects, and from distribution files but in most cases, you will install packages from PyPI.
we want to install a package named croniter, we can do that by issuing the following command:
pip install requests
To uninstall a package run:
pip uninstall requests

Python 3.6: how to install rubberband?

I want to use this function, and I'm trying to install rubberband using pip as the following: pip install rubberband
But, it raises the following error: "Failed building wheel for rubberband"
And I can't use Python 3.5 in my project. So, how to install rubberband?
P.S. My OS is Windows 10, and I have python 3.6 on it.
The docs you pointed to are the docs for the project pyrubberband, not rubberband. So install it with pip install pyrubberband.
As for rubberband: you probably need a C/C++ compiler to install it.
Upd. pyrubberband is a Python wrapper for rubberband. You need to install it, see https://breakfastquay.com/rubberband/index.html
To make a long story short, this is how I installed the rubberband python package.
apt update
apt-get install libsndfile-dev
apt-get install librubberband-dev
python3 -m pip install numpy (required for rubberband)
Note that the -dev postfix is required to get the header files that are later required for the python rubberband package to be able to compile the package.
Later, pip install rubberband failed on transform is not a member of std.
To solve that, I did the following:
python3 -m pip download rubberband
tar -xf rubberband-1.0.2.tar.gz
edit rubberband-1.0.2/src/numpy.cpp - add #include <algorithm> at the top of the file.
cd rubberband-1.0.2 and then run python3 -m pip install . or better yet python setup.py bdist_wheel --universal to create a whl file to add to your docker dependencies.
If you ran through this and using macOS, brew for everything works
$ brew install rubberband
Works like charm https://formulae.brew.sh/formula/rubberband
Install "rubberband-cli" Package on Ubuntu:
sudo apt-get update -y
sudo apt-get install -y rubberband-cli

Getting "ImportError: No Module named yaml" error

Computer: MacBook Pro mid 2012, running El Capitan 10.11.4
Python version 2.7.10
I've been trying to install ansible from source, and I've run these two commands (following the steps on ansibles documentation):
git clone git://github.com/ansible/ansible.git --recursive
cd ./ansible
and then ran this
source ./hacking/env-setup
I've also already installed these packages
sudo pip install paramiko PyYAML Jinja2 httplib2 six
However, if I try and run ansible by typing it in the terminal, I get the following error.
Traceback (most recent call last):
File "/Users/[myusr]/rock/ansible/bin/ansible", line 81, in <module>
from ansible.cli.adhoc import AdHocCLI as mycli
File "/Users/[myusr]/rock/ansible/lib/ansible/cli/__init__.py", line 27, in <module>
import yaml
ImportError: No module named yaml
What should be done here?
Do you have yaml module installed? If not, try installing yaml using the following command:
sudo pip install pyyaml
Had the same issue. Got past it using #FranMowinckel's answer.
First I typed:
pip --version
it outputted python 3. But, when I tried:
sudo python -m pip install pyyaml
I got an error saying:
Error: No module named pip
So, finally running:
sudo easy_install pip
everything worked fine.
Go back and run:
sudo python -m pip install pyyaml
(you may have to run this with all the other modules as well)
Now you should finally be able to run your initial command which failed.
For python 3.6 you can install it with
pip3 install pyyaml
if there is a problem in importing, do
pip3 uninstall pyyaml
and then install it again:
pip3 install pyyaml
#bigdata2's answer is correct but it might also happen that there's a conflict with python 3. So, check pip version (pip --version) and if it outputs python 3 then:
sudo python -m pip install pyyaml
So it gets installed for the same version as python.
I had this problem because I installed it with
sudo pip install pyyaml --upgrade
instead of
sudo -H pip install pyyaml --upgrade
Uninstalling and re-installing pyyaml fixed the problem for me.
This should work:
sudo pip install pyyaml
Try this
pip install ruamel.yaml

Resources