I am always having problems installing packages. Not sure how to do it...
I'm using google colab and I'm trying to import LibFMP.
With these 2 commands, I get "E: Unable to locate package LibFMP"
!apt-get install LibFMP
!apt install LibFMP
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package LibFMP
With pip command, I get
!pip install LibFMP
ERROR: Could not find a version that satisfies the requirement LibFMP (from versions: none)
ERROR: No matching distribution found for LibFMP
Why is this so and how do I import the LibFMP? It happens a lot for other packages as well. It would be great if you can help in explaining when I should use which command to install the packages. Thank you!
LibFMP does not seem to be available via pip. LibFMP is included in this zip file. I found it here.
I don't know how packages can be installed in Google Colab, but maybe you can upload the directory and install from source?
Maybe this notebook about LibFMP also helps.
At the time of the question, libfmp was not yet available on PyPi. This has changed in the meantime. You can simply install the package via pip, which also works in Google Colab.
!pip install libfmp
For more information, you can refer to
the documentation
the Github page
the FMP notebooks
Related
I have installed lxml and pillow using pip install lxml and pip install pillow and cmd is showing that I have successfully installed lxml and pillow but on importing lxml and pillow in jupyter notebook, it is saying that library not found:
jupyter notebook:-
Please help me to resolve this issue.
This question is asked so often all the time. With variations in the use of PyCharm as well. My recommendation for using Jupyter Notebook is to install any package within the notebook itself. In your case, create a cell containing:
!pip install lxml
!pip install pillow
After the installation is complete, you can safely remove it. You only need to install them once. You see? As simple as that. So, you are no longer need to think of using a different environment. It's easier if you are still a beginner. Then start learning all about the Python environment: https://docs.python.org/3/tutorial/venv.html and of course, not forget to mention about operating system path in case you have multiple version of Python (from Anaconda, the Microsoft Store, and Python official installer).
I have already defined a class which I want to use in my code.
in order to import it I know I have to install it first.(I am using google's colab)
to install first I uploaded the .py file into my drive which is mounted and no problem with that.
but still there is problem with installing the package.
how can I use this predefined class correctly in my code?
!pip install robotdef.py
Collecting robotdef.py
ERROR: Could not find a version that satisfies the requirement robotdef.py (from versions: none)
ERROR: No matching distribution found for robotdef.py
I think I overlooked one thing.
If "I uploaded the .py file into my drive which is mounted and no problem with that." is the situation, you don't have to run pip, but you'll need to expand the Python path to the directory where your package(class) is installed.
I hope this may help.
import sys
sys.path.append('/foo/bar/your-modules-path')
pip fetches a package from the Python Package Index (PyPI) repository. This means that the package must be registered on the repository first.
I tried to find 'robotdef.py' or 'robotdef' using a search form on the PyPI website, but it seems that 'robotdef.py' hasn't been registered yet...
If it's on the repository, !pip install <package name> will work fine on the Colab.
Supplement
Sorry, my answer was incomplete.
It's not necessary a package to be registered on the PyPI repository, but you can install a package from local archives, etc.
I am trying to install the python-weka-wrapper on Google Colab using
!pip install python-weka-wrapper
And I am seeing the following output:
Collecting python-weka-wrapper
Using cached https://files.pythonhosted.org/packages/2a/41/19c7bc2e177371cc273cc8aa17d66bd3ef9a6192160eecc56566ea31d959/python-weka-wrapper-0.3.15.tar.gz
Collecting javabridge>=1.0.14 (from python-weka-wrapper)
Using cached https://files.pythonhosted.org/packages/a6/a0/c59bccabed99b1d4ac68166c59c679b375bfca75b78688b52c541b711578/javabridge-1.0.18.tar.gz
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-24j9c0j5/javabridge/
I have successfully checked/installed all Python packages needed:
numpy
pillow
matplotlib
pygraphviz
I faced exactly the same error. Error is due to javabridge (a dependency) installation failing. In my case the error was due to the fact that I did not have JDK installed on my Google Colab Runtime.
Note: Even though JDK folders might be present in your machine (and similarly in Google Colab), doesn't necessarily mean that javac is present or works. Usually most machines have JRE running even though the JDK folders might seem to be present in the /usr/lib/jvm/ directory. That's what confounded me for a long time. So you have to apt install openjdk .
So, after installing openjdk properly and setting the JAVA_HOME properly, javabridge and python-weka-wrapper3 smoothly installed.
I'm summarizing all the commands I used to install python-weka-wrapper3 on Google Colab
import os
import sys
sys.path
sys.path.append("/usr/lib/jvm/java-11-openjdk-amd64/bin/")
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-11-openjdk-amd64/"
!apt-get install build-essential python3-dev
!apt-get install python3-pil python3-pygraphviz
!apt install openjdk-11-jdk
!pip3 install javabridge --no-cache-dir
!pip3 install python-weka-wrapper3 --no-cache-dir
import weka.core.jvm as jvm
jvm.start()
So, I hope this helps! Feel free to ask me any more questions related to this.
Also note while trying to rectify the issue, I came across some posts stating Oracle JDK might be necessary. Complete nonsense. weka-wrapper3 works just fine with openjdk.
The comments from this question helped me in understand the issue to resolve the error when I faced it.
All-
I would like to use the gensim library, but unfortunately I can't install it via pip due to the company's firewall. Any advice? Thank you in advance for any help or suggestions you can provide.
Tedious and only solution then is to download all the dependencies one by one and install them along with gensim. So, go to pypi and download gensim first and install it, then it might raise errors saying some package is missing or trying to download it.Then, download that specific package and install it via pip by giving path to the downloaded whl or source file
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.