1

My python version is 3.8. However, while Im trying to install scanpy using this command pip install scanpy in jupyter notebook, I'm getting following error message:

ERROR: matplotlib 3.5.3 has requirement packaging>=20.0, but you'll have packaging 19.2 which is incompatible.
ERROR: anndata 0.8.0 has requirement packaging>=20, but you'll have packaging 19.2 which is incompatible.
ERROR: pynndescent 0.5.8 has requirement importlib-metadata>=4.8.1; python_version < "3.8", but you'll have importlib-metadata 0.23 which is incompatible.
ERROR: pynndescent 0.5.8 has requirement llvmlite>=0.30, but you'll have llvmlite 0.29.0 which is incompatible.
ERROR: pynndescent 0.5.8 has requirement numba>=0.51.2, but you'll have numba 0.45.1 which is incompatible.
ERROR: umap-learn 0.5.3 has requirement numba>=0.49, but you'll have numba 0.45.1 which is incompatible.
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\numpy\\compat\\py3k.py'
Consider using the `--user` option or check the permissions.

Now I am unable to understand what should I do to fix this issue. Please assist me.

install scanpy

I have run this command in shell, but when I use jypyter notebook it again shows error message

I have restart the kernel but problem is still there....

  • It seems you have to upgrade all those packages: `pip install --upgrade matplotlib`. Are you sure you're using python 3.8 as kernel for your jupyter notebook ? It doesn't look like it's the case... – Syph Nov 15 '22 at 09:53
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – user11717481 Nov 15 '22 at 10:36
  • @Syph the python version is 3.7.4 in jupyter notebook – Iqra Imtiaz Nov 15 '22 at 10:41
  • @ellhe-blaster I have installed scanpy package using the command `pip install scanpy` , firstly it shows errors but now it generate the output _requirements already satisfied but I need to restart the kernel_ I restart the kernel but same output it generates. – Iqra Imtiaz Nov 15 '22 at 10:48
  • @ellhe-blaster I'm trying to run another command `import scanpy as sc` but I am getting error as **'Version' object has no attribute 'major'** . How this could be resolved. – Iqra Imtiaz Nov 15 '22 at 10:52
  • @ellhe-blaster plz assist me how to fix this issue of **You need to restart the kernel to use the updated packages** . – Iqra Imtiaz Nov 15 '22 at 12:01
  • I think you should update the libraries as indicated by the error message, if you are using jupyter you can run the command `conda update jupyter` and `pip install notebook --upgrade` or you can simply try to install each of the libraries indicating the specific compatible version using dos equals signs and the version number example: `pip install importlib-metadata==4.8.1` – user11717481 Nov 15 '22 at 12:15
  • "import scanpy as sc but I am getting error as 'Version' object has no attribute 'major' " belongs over in your [other post](https://stackoverflow.com/q/74445529/8508004), which shouldn't have been posted as it is the same issue. Posting multiple posts of the same issue causes multiple volunteers to use their time to probably say the same thing. Also it makes it hard for you, future you, and others having the same problem to find the solution. – Wayne Nov 15 '22 at 16:00

1 Answers1

0

As the error you posted says, it looks like you don't have permissions to install the required package. Try again the same command but in a shell opened as administrator.

Here's how to do it: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/jj717276(v=ws.11)

As an alternative, you can run jupyter itself as administrator. This should be enough as permission to install whatever you need.

Leno
  • 186
  • 13