Packages installed in miniconda but not anaconda - anaconda

I did not manage to install xgboost so I install something call miniconda. With the miniconda prompt i can use pip install xgboost works.
When I did it again I get the answer:
"Requirement already satisfied: xgboost in c:\users\anne-sophie\miniconda3\lib\site-packages\xgboost-0.6-py3.6.egg"
But when, in my jupyther notbook I do "import xgboost" I get an erreur:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-4-745aa3a2d734> in <module>()
----> 1 import xgboost as xgb
ModuleNotFoundError: No module named 'xgboost'
It seems that everything is installed in C:\Users\Anne-Sophie\Miniconda3\Lib\site-packages instead of C:\Users\Anne-Sophie\Anaconda3\Lib\site-packages and Anaconda must be connected to Anaconda3 and not mini conda3".
Do you have any ideas how I can connect anaconda to miniconda? I managed to make it work by copying lib and library from miniconda to anaconda but I am sure it might exist a way to do it easily.

Related

error while installing seaborn using pip and conda in jupyter notebook/terminal

I'm working in a jupyter notebook, and I'm trying to install seaborn using the following code:
import sys
!conda install --yes --prefix {sys.prefix} seaborn
But I get this error:
OSError Traceback (most recent call last)
Cell In [45], line 2
1 import sys
----> 2 get_ipython().system('conda install --yes --prefix {sys.prefix} seaborn')
...
File ~/Library/CloudStorage/OneDrive-Personal/Documents/Course-Programming/Machine-Learning/Projects/sample-project/env/lib/python3.10/site-packages/IPython/utils/_process_posix.py:57, in ProcessHandler.sh(self)
55 self._sh = pexpect.which(shell_name)
56 if self._sh is None:
---> 57 raise OSError('"{}" shell not found'.format(shell_name))
59 return self._sh
OSError: "/bin/fish" shell not found
I tried installing it using pip from my terminal, as well as removing /bin/fish from etc/shells but nothing changes. Can someone please point out what I'm doing wrong?
I solved this by removing the conda environment, then recreating it with seaborn as one of the packages, like this:
conda create --prefix ./env pandas numpy matplotlib jupyter scikit-learn seaborn
If you are not working in virtual environment then try these steps:-
1.) Go to Anaconda Navigtor
2.) Select Environment in Navigation panel.
3.) In base root, change filter option installed to non installed.
4.) Search Seaborn
6.) If its not installed then installed it

Is there new version of pygame for anaconda env?

I have pygame in pip environment and used it without problem.
But now I switched to conda environment (called tf-gpu) to have TF features also.
As I figured out the most used channel for conda version of pygame is cogsci.
But conda install -c cogsci pygame in terminal causes an error:
It seems there is a version incompatibility.
I then downloaded the original tar.bz2 file from conda, and tried conda install --offline C:\...(file path)
It downloaded and recognized by interpreter(python 3.8.8, conda('tf_gp' env)).
Then Pyhton imported pygame but error of there is no module "from python.base import *" proceeded it.(as it is in the __init__ file of package)
Are these problem due to old version of pygame? I tried other channels in anaconda but unsuccessful(also they were older).
And also i can not downgrade python because of many packages' prerequisites.
I also tried installing via pip(in that conda promp), but it said that the requirment has been satisfied(as i previoisly used pygame in pip env(python 3.8.2).
Is there any new conda version of pygame?
Should i remove previous pygame in pip and try pip install again in conda env?
Or is it possible to modify main package source code(old file)?
This issue usually comes in when you are running many versions of python and pygame together which causes some incompatibility. Another problem which may occur is that anaconda environment stop recognising the pygame as it can’t locate it.
My suggestion is that uninstall all the older versions of python and pygame and install the latest ones.
Or else you may shift to Visual studio code for better experience and lesser problems.
Thanks,
The problem was solved by uninstalling other python version that I had(3.6). and using pip version of pygame(which did not work when two python versions (3.6, 3.8) were on my system.)

import torch OSError: [WinError 127]

I'm trying to install torch-gpu. I have installed cuda 11.1 and installed torch via the command pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
It is so stupid but during the importing I have the following error OSError: [WinError 127] Error loading "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\torch\lib\c10_cuda.dll" or one of its dependencies..
c10_cuda.dll exists in that directory, I spent several days and still can't solve it. I need torch-gpu and that's the point of using that possibility, please, do not comment 'install torch-cpu'.
Answering the question myself
To install torch-gpu one should:
check the latest (or not) versions and compatible cuda version: https://pytorch.org/get-started/locally/, at this moment it is 11.1.
download and install cuda of the established version in 1) step (https://developer.nvidia.com/cuda-toolkit-archive). That depends on the gpu, if any problems you may download older versions or maybe you have it installed? then you can check version manually in the command line: nvcc --version.
install torch using commands as found in the 1) step (for instance conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge)
check the installation success as import torch torch.cuda.is_available().
In my case I had to delete previously installed torch pip uninstall torch and use conda clean -a for installation to end successfully.

ModuleNotFoundError: No module named 'skimage' when already installed new version scikit-image

I want to ask that I face the problem:
ModuleNotFoundError: No module named 'skimage'
even though I have already pip3 install scikit-image.
1
my version is Python 3.7.2
and when typing pip3 list, the version is:
scikit-image 0.17.2
Does any one know how to solve this problem?
Thank you very much
scikit-image and scikit-learn are two different packages. The latest scikit-image version is 0.17.2. Are you sure you have installed scikit-image?
It also depends wether you are on a Anaconda plateform or a local python platform in your computer (c:\User....). If python is installed directly in your computer outside Anaconda, this error may occur when importing the scikit-image library. In such case, you should re-install the scikit-image library from the Anaconda plateform by typing the command 'conda install scikit-image' from the Ananconda prompt or terminal.

installing python packages via pip issues

all I want is install pandas comfortably the package pandas via pip.
Inside python I get the following error message:
>>> pip install pandas
c:\python34\python.exe: No module named pip.__main__; 'pip' is a package and cannot be directly executed
Allright then I use the windows powershell
PS C:\Windows\system32> C:\Python34\python.exe -m pip install pandas
C:\Python34\python.exe: No module named pip
I had uninstalled and reinstalled python because I used at first the 32-Bit version but wanted 64-Bit, but had some issues so switched back to the 32-Bit version.
Before the reinstallation process I remember, that I could get pip to work but due to proxy issues didn't get very far. I am not a hundred percent positive but I might have gotten around the proxy issue at least.
Don't know what to do. Can somebody help.
thanks
Gerrit

Resources