I was trying to install some packages in R and I have run into an error:
Error: package or namespace load failed for ‘leiden’:
.onAttach failed in attachNamespace() for 'leiden', details:
call: py_module_import(module, convert = convert)
error: ModuleNotFoundError: No module named 'pandas'
This is strange to me because I definitely have pandas:
$ conda list | grep pandas
pandas 1.0.1 py37h0573a6f_0
Also which python seems to give me my anaconda installation:
/home/usrname/anaconda3/bin/python
I am installing these packages on WSL (Windows Subsystem for Linux) Ubuntu.
Any advice appreciated.
I ended up finding another issue with a similar problem. Turns out I needed to activate the conda r-reticulate environment.
Take a look at a similar question here: Python in R - Error: could not find a Python environment for /usr/bin/python
Related
I need to use the sksparse.chomod package however my pycharm does not let me install it as it can't seem to find it.
I found the sksparse package on github and downloaded it but I do not know how to add a package downloaded from the internet into a conda environment. So, my first question would be can you download a package from github and add it to your conda environment, and how do you do this?
As I did not know how to do the above I instead saved the package within my project and thought I could simply import sksparse.cholmod. However, the line in my code that says import sksparse.cholmod as sks has no errors with it, so I assumed that meant this was ok, but when I try to run my file I get this error:
import sksparse.cholmod as sks
ModuleNotFoundError: No module named 'sksparse.cholmod'
If I have downloaded the package into my project why can't it be found, yet there are no errors when importing?
The cholmod file is a pyx file which I've been told should not be a problem.
Please could anyone help, I am reasonably new to python and I am looking for a straight forward solution that won't be time consuming.
It was an issue with windows, I was able to fix this using the instructions on this link
https://github.com/EmJay276/scikit-sparse
We must follow these steps precisely:
(This was tested with a Anaconda 3 installation and Python 3.7)
Install these requirements in order:
'''
conda install -c conda-forge numpy - tested with v1.19.1
conda install -c anaconda scipy - tested with v1.5.0
conda install -c conda-forge cython - tested with v0.29.21
conda install -c conda-forge suitesparse - tested with v5.4.0
'''
Download Microsoft Build Tools for C++ from https://visualstudio.microsoft.com/de/visual-cpp-build-tools/ (tested with 2019, should work with 2015 or newer)
Install Visual Studio Build Tools
Choose Workloads
Check "C++ Buildtools"
Keep standard settings
Run ''' pip install git+https://github.com/EmJay276/scikit-sparse '''
Test ''' from sksparse.cholmod import cholesky '''
Use all the versions stated for numpy etc, however with scipy I installed the latest version and it worked fine.
I have started getting this error for a "plspm" module in python which is part of R library after I 'conda install plspm' on my windows 10 OS. Installation has been done properly but i could not able to import plspm in python getting "No module" error. Please anyone help me to resolve.Thanks.
version of r-plspm is -0.4.9
needed packages already installed(scipy,skit-learn,pandas,numpy,statsmodule).
command used to install:
conda install -c conda-forge r-plspm
Screen shot of installed plspm:
Error:
Window 10
anaconda v5.0.1 -python v3.6.3 runs
jupyter v4.3.0 -python v3.6.3 runs
on cmd : C:\User\KRX>python --version
And I got > Python 3.5.6 :: Anaconda, Inc.
Hi, I had ModuleNotfoundError: No module named 'word2vec' after installing 'word2vec' following this procedure below.
1.download get-pip.py on https://bootstrap.pypa.io/get-pip.py. On cmd python get-pip.py
2.Install gensim in windows
On cmd: pip install scipy,
On cmd: pip install gensim
3.Install word2vec
On anaconda prompt: conda install -c anaconda word2vec
Until then, I had no problem but when I tried to import word2vec on jupyter notebook, I had ModuleNotfoundError as I already mentioned above.
I tried to reinstall 'word2vec' but I fell into another error :
ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'anaconda::tqdm-4.43.0-py_0'.
CondaError: Cannot link a source that does not exist. C:\User\KRX\Anaconda3\Scripts\conda.exe
Running 'conda clean --packages' may resolve your problem
I tried conda clean --packages but nothing changed
I also tried conda update anaconda and got same error (CondaError : Cannot link a source that does not exist...etc)
ps. This is my first time asking a question so if you need any other details please let me know. I thank y'all.
Using the macOS terminal, I'm trying to run ./autoner_train.sh by following this guide on GitHub.
I have activated my Conda environment and check my PyTorch version
(pytorch_env) myname (master) AutoNER $ python -c "import torch; print(torch.__version__)"
1.3.1
After that, when running, I get the following error
ModuleNotFoundError: No module named 'torch_scope'
I don't know where's the problem. I have installed everything and I tried googling the problem, all I found is that I need PyTorch installed, which I already have.
I the documentation at the Dependencies section you can read:
Dependencies
This project is based on python>=3.6. The dependent package for this
project is listed as below:
numpy==1.13.1
tqdm
torch-scope>=0.5.0
pytorch==0.4.1
So you need to install torch-scope>=0.5.0 too:
pip install torch-scope
I am trying to package some R packages from CRAN to use in a conda environment because I am using a combination of Python and R packages for a bioinformatics pipeline. Because of other dependencies, I need to keep R at version 3.3
I made a brandnew environment with the version of Python and R I want:
$ conda create -n bioinfo python=3.6.3 r=3.3.2
There is no R installed in the root environment. Then I follow the instructions for conda skeleton:
(bioinfo)$ conda skeleton cran rootSolve
(bioinfo)$ conda skeleton cran rootSolve
(bioinfo)$ conda build r-rootsolve
For some reason, this keeps coming up with an R3.4 dependency, even though according to CRAN, the rootSolve package only needs R>=2.01! Where is this coming from??
The following NEW packages will be INSTALLED:
r-base: 3.4.2-haf99962_0
Though building the package does not actually change the version of R running in my environment, the package does not load. Any ideas, please?
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
> library('rootSolve')
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/people/bioc1402/miniconda3/envs/bioinfo2/lib/R/library/rootSolve/libs/rootSolve.so':
/usr/people/bioc1402/miniconda3/envs/bioinfo2/lib/R/library/rootSolve/libs/rootSolve.so: undefined symbol: R_ExternalPtrAddrFn
In addition: Warning message:
package ‘rootSolve’ was built under R version 3.4.2
Error: package or namespace load failed for ‘rootSolve’
Apparently this was a bug, now fixed in conda-build 3.1.3,
https://github.com/conda/conda-build/issues/2562
Thanks conda team!
'conda build r-rootsolve --R=3.3.1' now works appropriately with the recipe generated by conda skeleton.