Disclaimer: something went wrong with my Anaconda environment at one point and my best guess was simply to uninstall/reinstall Anaconda, but now I have been getting the following errors.
I have reinstalled Anaconda successfully, and can verify the presence of various modules. However, when I try to call any given module in Terminal (e.g., jupyter notebook) I get a variation of the following error:
Traceback (most recent call last):
File "/Users/MYNAME/anaconda3/bin/jupyter", line 7, in <module>
from jupyter_core.command import main
ImportError: No module named jupyter_core.command
I do not have sufficient experience with command line programming to decipher other posts on this topic... I'm assuming there's a problem with the executable paths or something? If it helps, here is the output of conda info for me:
active environment : None
shell level : 0
user config file : /Users/MYNAME/.condarc
populated config files : /Users/MYNAME/.condarc
conda version : 4.6.8
conda-build version : 3.17.6
python version : 3.7.1.final.0
base environment : /anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/osx-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /anaconda3/pkgs
/Users/MYNAME/.conda/pkgs
envs directories : /anaconda3/envs
/Users/MYNAME/.conda/envs
platform : osx-64
user-agent : conda/4.6.8 requests/2.21.0 CPython/3.7.1
Darwin/18.5.0 OSX/10.14.4
UID:GID : MYUID
netrc file : None
offline mode : False
Just reinstall jupyter notebook under that specific conda virtual environment.
Like:
balabala$ conda activate tensorflow_gpuenv
balabala$ pip install jupyter
(I am using ubuntu.)
Related
I'm using spyder to make my codes.
I try to use pygmt lib but, in my spyder-env I have an error :
GMTCLibNotFoundError: Error loading GMT shared library at 'libgmt.so'.
libgmt.so: cannot open shared object file: No such file or directory
According to the pygmt documentation, I have to create a new env to use this lib, so I did :
conda create --name pygmt --channel conda-forge pygmt
conda activate pygmt
But I have 2 problems :
spyder launch itself with the 3 version instead of 5 (as in my spyder-env/ typically).
Error stays :
GMTCLibNotFoundError: Error loading GMT shared library at '/home/vialb/miniconda3/envs/pygmt/lib/libgmt.so'.
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/vialb/miniconda3/envs/pygmt/lib/./libgdal.so.31)
Error loading GMT shared library at 'libgmt.so'.
libgmt.so: cannot open shared object file: No such file or directory
I'm not familiar with environment so, I don't know what tot do with this...
Any idea ?
Hum, not sure if I done something different, but that's working now, with this procedure :
on the (base) environnement, create pygmt env with :
conda create --name pygmt --channel conda-forge pygmt
activate the new env :
conda activate pygmt
install spyder
conda install spyder
And ... That's all. Spyder open in version 5 and import pygmt works too.
Plotly figures are not rendered/displayed in jupyterlab. I therefore tried to install the extension jupyter labextension install #jupyter-widgets/jupyterlab-manager jupyterlab-plotly. Afterwards I was asked to run the jupyter lab build and this failed. I have no idea where the problem is.
Install info:
I installed a venv with pyenv running python 3.8.5.
jupyter --version
jupyter core : 4.7.1
jupyter-notebook : 6.4.0
qtconsole : not installed
ipython : 7.25.0
ipykernel : 6.0.3
jupyter client : 6.1.12
jupyter lab : 3.0.12
nbconvert : 6.1.0
ipywidgets : 7.6.3
nbformat : 5.1.3
traitlets : 5.0.5
npm --version
7.11.2
node --version
v16.1.0
I am restricted to use WSL1 because of company requirements.
I’ll post below the command outputs for
jupyter labextension list
jupyter lab build
cat /tmp/jupyterlab-debug-5vr2zquq.log
jupyter labextension install #jupyter-widgets/jupyterlab-manager --minimize=False
Any advice would be appreciated. I have no idea how to fix this.
Thanks
❯ jupyter labextension list
JupyterLab v3.0.16
/home/bebop/.local/share/jupyter/labextensions
#jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)
/mnt/s/dokumente/Privat/neue_fische/ot/ot-sopra_steria/.venv/share/jupyter/labextensions
jupyterlab-plotly v5.1.0 enabled OK
Other labextensions (built into JupyterLab)
app dir: /mnt/s/dokumente/Privat/neue_fische/ot/ot-sopra_steria/.venv/share/jupyter/lab
plotlywidget v4.14.3 enabled OK
Build recommended, please run jupyter lab build:
plotlywidget needs to be included in build
❯ jupyter lab build
[LabBuildApp] JupyterLab 3.0.16
[LabBuildApp] Building in /mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab
[LabBuildApp] Building jupyterlab assets (production, minimized)
Build failed.
Troubleshooting: If the build failed due to an out-of-memory error, you
may be able to fix it by disabling the dev_build and/or minimize options.
If you are building via the jupyter lab build command, you can disable
these options like so:
jupyter lab build --dev-build=False --minimize=False
You can also disable these options for all JupyterLab builds by adding these
lines to a Jupyter config file named jupyter_config.py:
c.LabBuildApp.minimize = False
c.LabBuildApp.dev_build = False
If you don’t already have a jupyter_config.py file, you can create one by
adding a blank file of that name to any of the Jupyter config directories.
The config directories can be listed by running:
jupyter --paths
Explanation:
dev-build: This option controls whether a dev or a more streamlined
production build is used. This option will default to False (i.e., the
production build) for most users. However, if you have any labextensions
installed from local files, this option will instead default to True.
Explicitly setting dev-build to False will ensure that the production
build is used in all circumstances.
minimize: This option controls whether your JS bundle is minified
during the Webpack build, which helps to improve JupyterLab’s overall
performance. However, the minifier plugin used by Webpack is very memory
intensive, so turning it off may help the build finish successfully in
low-memory environments.
An error occured.
shutil.Error: [(’/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/staging/templates’, ‘/mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab/staging/templates’, “[Errno 13] Permission denied: ‘/mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab/staging/templates’”)]
See the log file for details: /tmp/jupyterlab-debug-5vr2zquq.log
❯ cat /tmp/jupyterlab-debug-5vr2zquq.log
[LabBuildApp] Building in /mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab
[LabBuildApp] Node v16.1.0
[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] Traceback (most recent call last):
[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/debuglog.py”, line 47, in debug_logging
yield
[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/labapp.py”, line 166, in start
raise e
[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/labapp.py”, line 162, in start
build(name=self.name, version=self.version,
[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/commands.py”, line 469, in build
return handler.build(name=name, version=version, static_url=static_url,
[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/commands.py”, line 657, in build
self._populate_staging(
[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/commands.py”, line 1180, in _populate_staging
shutil.copytree(pjoin(HERE, ‘staging’, ‘templates’), templates)
[LabBuildApp] File “/home/bebop/.pyenv/versions/3.8.5/lib/python3.8/shutil.py”, line 554, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
[LabBuildApp] File “/home/bebop/.pyenv/versions/3.8.5/lib/python3.8/shutil.py”, line 510, in _copytree
raise Error(errors)
[LabBuildApp] shutil.Error: [(’/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/staging/templates’, ‘/mnt/s/dokumente/Privatpath/.venv/share/jupyter/lab/staging/templates’, “[Errno 13] Permission denied: ‘/mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab/staging/templates’”)]
[LabBuildApp] Exiting application: JupyterLab
❯ jupyter labextension install #jupyter-widgets/jupyterlab-manager --minimize=False
Building jupyterlab assets (production, not minimized)
An error occured.
shutil.Error: [(’/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/staging/templates’, ‘/mnt/s/dokumente/path/.venv/share/jupyter/lab/staging/templates’, “[Errno 13] Permission denied: ‘/mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab/staging/templates’”)]
You should not need to install the extension from source. JupyterLab 3.0 introduced prebuilt extensions system that allows users to install extensions from pip (and conda) without the need for the build step making all the trouble of troubleshooting failed builds disappear. It seems that you used an old set of instructions for installing plotly, as plotly 5.0+ supports prebuilt extensions for JupyterLab. First uninstall the source extensions that you just installed (non of those are needed):
jupyter labextension uninstall #jupyter-widgets/jupyterlab-manager jupyterlab-plotly plotlywidget
Optional: verify list of extensions with:
jupyter labextension list
Then install a new plotly version with pip or conda:
pip install "plotly>=5" "ipywidgets>=7.6"
# or, if using conda:
# conda install -c conda "plotly>=5"
# conda install "ipywidgets>=7.6"
Both widget and renderer are included, so no need to install plotlywidget separately.
Check list of extensions again:
jupyter labextension list
You should now see lines with:
jupyterlab-plotly v5.1.0 enabled OK
#jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)
(the version may be newer in the future of course).
I have python 3.7 and latest anaconda.
I am having Solving environment: failed issue with this error code.
ResolvePackageNotFound:
- jpeg==9c=h470a237_1
Could anyone teach me how to solve this problem?
(base) Koos-MBP:downloads jackykoo$ conda env create -f cvcourse_macos.yml
Collecting package metadata (repodata.json): done
Solving environment: failed
ResolvePackageNotFound:
- jpeg==9c=h470a237_1
- twisted==17.5.0=py36_0
(base) Koos-MBP:downloads jackykoo$
Here is my conda info
(base) Koos-MBP:downloads jackykoo$ conda info
active environment : base
active env location : /Users/jackykoo/opt/anaconda3
shell level : 1
user config file : /Users/jackykoo/.condarc
populated config files : /Users/jackykoo/.condarc
conda version : 4.7.12
conda-build version : 3.18.9
python version : 3.7.4.final.0
virtual packages :
base environment : /Users/jackykoo/opt/anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /Users/jackykoo/opt/anaconda3/pkgs
/Users/jackykoo/.conda/pkgs
envs directories : /Users/jackykoo/opt/anaconda3/envs
/Users/jackykoo/.conda/envs
platform : osx-64
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4 Darwin/19.0.0 OSX/10.15
UID:GID : 501:20
netrc file : None
offline mode : False
I have (what I thought to be) a stable conda environment (hold your laughter). In this environment, I've installed numba via pip (again, hold your laughter). I'd like to uninstall via pip, and re-install via conda.
I find this, after uninstalling via pip:
(tasso) ubuntu#ip-XXX:~/Work/ds_util/tasso$ conda install anaconda
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are missing from the target environment:
- mkl==2018.0.3=intel_1
- openmp==2018.0.3=intel_0
- intel-openmp==2019.1=intel_144
- zlib==1.2.11=5
- libffi==3.2.1=11
All of the typical conda tricks don't work here: conda install anaconda gives the same list of missing packages. I would expect a package manager to, you know, manage these packages? Is this a miniconda thing?
More context:
(tasso) ubuntu#ip-XXX:~/Work/ds_util/tasso$ conda info
active environment : tasso
active env location : /home/ubuntu/miniconda3/envs/tasso
shell level : 2
user config file : /home/ubuntu/.condarc
populated config files : /home/ubuntu/.condarc
conda version : 4.7.11
conda-build version : not installed
python version : 3.7.3.final.0
virtual packages :
base environment : /home/ubuntu/miniconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
package cache : /home/ubuntu/miniconda3/pkgs
/home/ubuntu/.conda/pkgs
envs directories : /home/ubuntu/miniconda3/envs
/home/ubuntu/.conda/envs
platform : linux-64
user-agent : conda/4.7.11 requests/2.22.0 CPython/3.7.3 Linux/4.15.0-1016-aws ubuntu/18.04.1 glibc/2.27
UID:GID : 1000:1000
netrc file : None
offline mode : False
I'm frustrated by environments that seem to always be out of sync with conda, is this a common problem people deal with?
I've been used anaconda for 2 months and it's fantastic tool for me.
At first, I'd started with anaconda 2 (w/ python 2.7) but I changed to the latest version, which has python 3.4 and currently my anaconda version is 2.2.0.
And, because I should install basemap library I googled and found the answer that anaconda can support basemap using it's conda tool.
But, when I finished conda install basemap, I saw the messssage that conflict occured with python 3.4 like below.
Fetching package metadata: Could not connect to https://repo.continuum.io/pkgs/free/win-64/
Could not connect to https://repo.continuum.io/pkgs/pro/win-64/
Could not connect to https://repo.continuum.io/pkgs/free/noarch/
.Could not connect to https://repo.continuum.io/pkgs/pro/noarch/
...
Solving package specifications: ..
Error: Unsatisfiable package specifications.
Generating hint:
[ COMPLETE ] |#################################################| 100%
Hint: the following combinations of packages create a conflict with the
remaining packages:
- python 3.4*
- basemap
I understand this message as I should change my python version. Is it right? If so, how can I chnage, I mean downgrade from 3.4 to 3.3?
If not, why installation failed?
Getting a specific version of Python, or a package, is very easy in Anaconda. Anaconda allows you to create environments where you can have specific versions separated from each other.
conda create -n py33 python=3.3 basemap
The above will create an environment with python 3.3, basemap, and any dependencies needed. The format is to specify a name after the -n(I used py33) and specify the version after the package with an equals sign. Then to use this environment you simply activate it as follows:
Windows:
source py33
Mac OS X/Linux:
source activate py33
Per docs, basemap is only available for Python 2.7 on windows OS. For Unix systems it's available for Python 2.6, 2.7, 3.3 and 3.4.
The conflict occurs when you you have Python 3.x on windows and you try to install Basemap through conda install basemap.
Here's conda info basemap output specifically listing the dependencies for the variant versions of numpy.
C:\Anaconda3>conda info basemap
Fetching package metadata: ....
basemap 1.0.7 np19py27_0
------------------------
file name : basemap-1.0.7-np19py27_0.tar.bz2
name : basemap
version : 1.0.7
build number: 0
build string: np19py27_0
channel : defaults
size : 120.5 MB
date : 2014-09-09
license : PSF
md5 : 18142d0b3ede8b156f31c627d78aea72
installed environments:
dependencies:
matplotlib
numpy 1.9*
python 2.7*
basemap 1.0.7 np18py27_0
------------------------
file name : basemap-1.0.7-np18py27_0.tar.bz2
name : basemap
version : 1.0.7
build number: 0
build string: np18py27_0
channel : defaults
size : 120.5 MB
date : 2014-08-22
license : PSF
md5 : 14cabc1a134b14073fe3afa943753888
installed environments:
dependencies:
matplotlib
numpy 1.8*
python 2.7*
basemap 1.0.7 np17py27_0
------------------------
file name : basemap-1.0.7-np17py27_0.tar.bz2
name : basemap
version : 1.0.7
build number: 0
build string: np17py27_0
channel : defaults
size : 120.5 MB
date : 2014-08-22
license : PSF
md5 : 6bcb42a4435836b342c96d94a98ef785
installed environments:
dependencies:
matplotlib
numpy 1.7*
python 2.7*
basemap 1.0.7 np110py27_0
-------------------------
file name : basemap-1.0.7-np110py27_0.tar.bz2
name : basemap
version : 1.0.7
build number: 0
build string: np110py27_0
channel : defaults
size : 120.5 MB
date : 2015-10-06
license : PSF
md5 : e451471ff2a2ccdbf09e81c61cc103bb
installed environments:
dependencies:
matplotlib
numpy 1.10*
python 2.7*
The anaconda install doesn't work with Python 3 right now so going from 3.4 to 3.3 won't help you. Here is what I had to do to get basemap with anaconda (on Windows):
Create a new environment with the latest version of Python 2
conda create --name py2 python=2.7
Change to that environment:
activate py2
Install basemap:
conda install -c https://conda.anaconda.org/anaconda basemap