I have played around with Python a little but never have I had to install my own packages. I am currently trying to write a program that reads in 'tiff' files so I'm trying to install the 'libtiff' package and I'm having a nightmare!
First, I was using the Anaconda distribution and the phrase 'conda install libtiff' which would tell me the install was successful. However then I was never able to find libtiff in the Spyder IDE or ipython console.
Having used Canopy in the past, I uninstalled Anaconda and gave Canopy another shot using 'pip install libtiff', however I receive an error saying it failed with error code 1 and I don't know what this is.
I must be missing something fairly crucial but installing this module is proving almost impossible!
Conda's libtiff package is the C library, not the Python library. The easiest way to get it would be to use conda to install the dependencies (like libtiff, numpy), and then use pip to install libtiff (pip install libtiff).
Using ! on the IPython console within spyder allows you to use pip. So, in the example, you could do:
In [1]: !pip install libtiff
Note, this is also available (though perhaps unreliably) on the Python console for Spyder versions before ~2.3.3.
Related
I use Python and pycharm as a tool.
If you use the pip statement to install the library, you will get an error.
For example, if I want to download the torch (1.6.0) version and type pip install torch==1.6.0,
It says no version.
This is not the end, but some libraries continue to cause strange conflicts and will not be installed.
For example, if you type pip install poro to install the poro library, an unknown error pops up and the installation fails.
I'm not asking for a pororo installation.
My question is, I want to know how to download the library without relying on pycharm.
I want to download it separately from a site like pypi and put the library directly into the virtual environment (conda).
What should I do?
The following worked for me:
First, install mkl using conda:
conda install -c anaconda mkl
Then run this:
conda install -c pytorch pytorch
As the Anaconda Distribution of Spyder has some typing latency issues on macOS Big Sur, I've gone ahead and downloaded the standalone distribution. However, when trying to install packages with pip I get the error message:
pip install numpy
/Applications/Spyder.app/Contents/MacOS/python: No module named pip
Note: you may need to restart the kernel to use updated packages.
(I know that NumPy is already installed - this just serves as an example). I have Anaconda installed, and there pip works fine. How do I install it for the specific Standalone Distribution?
I solved this problem using the Command Prompt and typing pip install -U spyder. If you don't have the "standalone version" of Python, just install it to have access to this command.
After that, you can simply open Spyder typing in the Command Prompt spyder.
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 am new to python and I am having trouble downloading some new libraries that don't appear to be pre-installed. The names of them are rasterio and retrying. I continuously get an invalid syntax error, and I have tried using some different suggestions found online.
pip install rasterio
Above is the way I was attempting to do it, and I also tried without the pip in there, but neither option worked. I am new enough to the language that troubleshooting is very difficult. Any help is greatly appreciated!
There are several ways to install rasterio, using anaconda you have the documentation here: https://anaconda.org/conda-forge/rasterio
If you are on windows installing rasterio using pip install can be difficult since it requires binary wheels, but here is the tutorial: https://rasterio.readthedocs.io/en/latest/installation.html
I advise you to use linux since it is much easier to install packages, you can either install a dual boot or a virtual box.
I suppose you are using Spyder IDE with Anaconda. So, to install rasterio package you can open anaconda prompt and type:
conda install -c conda-forge rasterio
For further information about package installation check out this link.
Also, to install any conda packages just google it once, you will find instructions to install it mostly in anaconda's official site.
Edit:
Please remove the rasterio package once. And install it again, see if works. If it doesn't work create a new environment like: conda create --name myenv. Then install rasterio again.
If this still doesn't work, try to install rasterio from here like conda install -c ioos rasterio.
For example, installing IPython on Linux (where setuptools is not installed) I've got IPython installed in site-packages\IPython.
Installing IPython on Windows (where IPython requires setuptools), after executing the same command
python setup.py install
I get IPython installed in site-packages\ipython-0.13.2-py2.7.egg\IPython
Is there a way to install the module "old way" i.e. into site-packages\IPython?
I've discovered that
python setup.py install --old-and-unmanageable
does the job, but I am not sure it is a good way as --old-and-unmanageable is marked "Try not to use this!".
I don't know if it's applicable in your case, but the --root option also does this. For example, the Fedora packaging guidelines make use of this, since the versioning is managed externally by RPM. https://fedoraproject.org/wiki/Packaging:Python_Eggs