trouble installing flask_cors and pillow on mac - python

I'm very new to python and just downloaded Anaconda and installed Pycharm. Now that all this is installed I'm stuck with Flask_cors and Pillow, which are needed for a project.
You can see the error in the screenshot below.
I've tried to install via pip command in terminal, and also specifying the target folder (like described in another post) or updating Flask and Pillow via Anaconda, nothing seems to work.
FYI I'm running Mac OS 10.12.6
Thanks for your help!

Looks like you're using anaconda. So, I'd suggest you start from scratch, make a new environment and follow this route:
Deactive your old conda environment
conda deactivate
Make a new conda environment
conda create -n myenv python=3.7
Activate your new environment
conda activate myenv
Install your dependencies. Since it's a conda environment, you should use conda commands to install the dependencies. See here why.
conda install -c anaconda flask
conda install -c conda-forge flask-cors
conda install -c anaconda pillow
Now try again.

Related

Unable to update or install any package

I am trying to update matplotlib but getting an error. Error message : EnvironmentNotWritableError: The current user does not have write permissions to the target environment. environment location: C:\Users\DeepakKumar\Anaconda3 How to fix this issue?
Some Specs:
Anaconda3 2019.10
Python 3.7.4 64-bit
matplotlib 3.1.1
If you are using Windows, try to open your shell as an administrator and then run pip/conda install that will install it.
Also, I highly recommend using virtual environments to install libraries and avoid conflict in dependencies.
You can use virtualenv: https://virtualenv.pypa.io/en/latest/
Or conda management environemnts.
Basically, you create a new environment:
conda create -n my_env
conda activate my_env
conda install matplotlib
This will avoid these kind of problems.
You can also read more about it here: conda-envs
Search for Anaconda Prompt, Run the Prompt as Administrator (Right Click and select Run as Admin), then use conda update <package>, this shall solve your current issue, but this is just a workaround.
As Admin you should run conda update -n base -c defaults conda. This way your Anaconda should now update without admin related errors.

How to use egg to install scikit-image?

I am stuck on this installation of scikit-image (aka skimage). I tried multiple ways:
Installation from a git hub folder (using the requirements.txt)
Installation from a whl file
Installation with pip install scikit-image
All three trials failed during the import: import skimage
ImportError: cannot import name 'geometry'
It seems that scikit-image has not been built correctly.
Your install of scikit-image appears to be broken.
Try re-installing the package following the instructions at:
https://scikit-image.org/docs/stable/install.html
I went through internet but did not find solutions besides the ones above.
Does anyone went through that before?
One possibility seems to be to pip install with -egg, but I found that for Mac rather than Windows.
EDIT:
Hi everyone, so I found a solution but this is kind of very hard and I still don't understand why it did not work before.
I just:
uninstall anaconda
uninstall python
install python (3.8)
install Anaconda (I have trouble with Spyder now^^)
If you want to code for computer vision/Image processing/machine learning tasks, then it can be done in pycharm with conda environment very easily. There is no need to install python separately to run Anaconda.
First, download and install pycharm. Next, If you use windows then download Anaconda 64 bit python 3.7 version from here,
https://www.anaconda.com/distribution/#windows
You can find some details about managing environment and helpful links here,
How to create some environments for tensorflow in anaconda?
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
Create a conda environment first using Anaconda Prompt command line,
conda create -n cvenv python=3.7
Now activate that environment using. By default base is activated.
conda activate cvenv
Next, install the packages you want,
conda install -c conda-forge scikit-learn
conda install -c conda-forge scikit-image
conda install -c conda-forge pillow
conda install -c conda-forge opencv
I use conda-forge packages as they are more recent. Finally, open pycharm and create a new project by selecting existing python interpreter in conda environment. If none exists then select,
Browse > Add Python Interpreter > Conda Environment > Interpreter > Browse > Anaconda3 installation folder > envs folder > cvenv folder > Python.exe
You can test by creating a python file and writing import skimage.

Trying to install a pip package in Anaconda

I'm trying to follow this tutorial:
https://learn.microsoft.com/en-us/azure/machine-learning/service/tutorial-data-prep
As part of this I'm trying to do a pip install of azureml as it's not available on conda. However doing a pip install will by default install it to my default python install, and not my conda install.
So I tried following the steps here:
https://conda.io/docs/user-guide/tasks/manage-environments.html#using-pip-in-an-environment
However after following these steps I then launch Jupyter notebook after activating myenv, navigate to the notebook, and try and run:
import azureml.dataprep as dprep
But get the error: ModuleNotFoundError: No module named 'azureml'
Also - I cannot tell if myenv is active in the notebook. The kernel simply says python3.
Be careful, when using pip in anaconda, it is possible that you are mixing pip and pip3.
Run which pip3 to be sure you are using the version that correspond to the virtual environment.
If you are using python3 in the environment, then pip will typically be the correct version to use. Do not use pip3 in that case.
This problem has been documented elsewhere on the web. The problem is that Jupyter notebooks itself only launches in the root environment by default. The simplest solution to getting it to launch for your env (e.g. myenv) is to install Jupyter within your env first. So from the Anaconda command prompt:
activate myenv
pip install jupyter
jupyter
Ps. Use source activate myenv for non-windows machines

Cannot install mayvai after uninstalling and reinstalling anaconda due to conflicts

Snapshot of the error that I see
I uninstalled and reinstalled Anconda python 2.7, but when I am trying to do conda install mayavi, I see unsatisfiable error.Conflicts in bottleneck, mayavi and navigator-updator. Also tried doing pip install mayavi, it did not work. Kindly help!
mayavi package seems to have issues with many standard conda packages raising multiple conflicts.
Create new conda environment where you install mayavi, activate it and install mayavi in it.
conda create --name <your env name> python=2
source activate <your env name>
conda install mayavi

Conda and Miniconda doesn't include celery in repository

I am trying to install celery using conda in my Miniconda python distribution. I am using PyCharm to manage my project and packages. I have set up the project to use python installed with miniconda as distribution. Trying to install celery from pycharm package manager gives me no results. As well as trying to install conda from command line. Is there a way to install celerey using conda? Is there a way to use both pip and conda in parallerl? Can this be done through PyCharm?I also have python 2.7.10 installed in my windows pc. So I have two python installments in my system one in
C:\Python27
and one in
C:\Miniconda2
conda install celery return the following
Fetching package metadata: ....
Error: No packages found in current win-64 channels matching: celery
You can search for this package on anaconda.org with
anaconda search -t conda celery
You may need to install the anaconda-client command line client with
conda install anaconda-client
You can check the URL.
https://anaconda.org/conda-forge/celery
conda install -c conda-forge celery=3.1.25
I don't think celery is available as a conda package. You can install with pip into a conda environment, yes. But if at all possible you want to try to stick to conda packages.

Categories

Resources