wo nimmt jupyter notebook sein environment her? No module named 'iso8601'

Probleme bei der Installation?
Antworten
Krischu
User
Beiträge: 87
Registriert: Dienstag 14. Januar 2014, 09:07

Ich starte auf der Terminalzeile (macOS)

Code: Alles auswählen

jupyter notebook
Hatte zuletzt

Code: Alles auswählen

$ conda install iso8601
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /opt/anaconda3

  added / updated specs:
    - iso8601


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2022.2.1   |       hecd8cb5_0         122 KB
    certifi-2021.10.8          |   py37hecd8cb5_2         151 KB
    conda-4.11.0               |   py37hecd8cb5_0        14.4 MB
    iso8601-1.0.2              |     pyhd3eb1b0_0          14 KB
    openssl-1.1.1m             |       hca72f7f_0         2.2 MB
    ------------------------------------------------------------
                                           Total:        16.9 MB

The following NEW packages will be INSTALLED:

  iso8601            pkgs/main/noarch::iso8601-1.0.2-pyhd3eb1b0_0

The following packages will be UPDATED:

  ca-certificates    conda-forge::ca-certificates-2021.10.~ --> pkgs/main::ca-certificates-2022.2.1-hecd8cb5_0
  certifi            conda-forge::certifi-2021.10.8-py37hf~ --> pkgs/main::certifi-2021.10.8-py37hecd8cb5_2
  openssl            conda-forge::openssl-1.1.1l-h0d85af4_0 --> pkgs/main::openssl-1.1.1m-hca72f7f_0

The following packages will be SUPERSEDED by a higher-priority channel:

  conda              conda-forge::conda-4.11.0-py37hf98548~ --> pkgs/main::conda-4.11.0-py37hecd8cb5_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
certifi-2021.10.8    | 151 KB    | ##################################### | 100% 
openssl-1.1.1m       | 2.2 MB    | ##################################### | 100% 
ca-certificates-2022 | 122 KB    | ##################################### | 100% 
iso8601-1.0.2        | 14 KB     | ##################################### | 100% 
conda-4.11.0         | 14.4 MB   | ##################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
$ python
Python 3.8.11 (default, Jul  5 2021, 09:52:53) 
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
$ 

Aber im Notebook kriege ich:

Code: Alles auswählen


ModuleNotFoundError                       Traceback (most recent call last)
/var/folders/kc/5p61t70n0llbn05934gj4r_w0000gn/T/ipykernel_1449/3660314455.py in <module>
      3 import dateutil.parser as dp
      4 from datetime import datetime
----> 5 import iso8601
      6 
      7 data= {

ModuleNotFoundError: No module named 'iso8601'

Muß ich das notebook neu starten?
--
Grüße
Christoph
Sirius3
User
Beiträge: 17747
Registriert: Sonntag 21. Oktober 2012, 17:20

Hast Du Dein Notebook im selben Environment gestartet, wie Du iso8601 installiert hast?
Krischu
User
Beiträge: 87
Registriert: Dienstag 14. Januar 2014, 09:07

Sirius3 hat geschrieben: Dienstag 8. März 2022, 11:57 Hast Du Dein Notebook im selben Environment gestartet, wie Du iso8601 installiert hast?
Denke schon. Von derselben Kommandozeile, von der ich auch obige Commands abgesetzt hatte.

Code: Alles auswählen

$ which jupyter
/Users/kuku/anaconda3/bin/jupyter
$ conda env list
# conda environments:
#
                         /Users/kuku/opt/anaconda3
base                  *  /opt/anaconda3
myapp                    /opt/anaconda3/envs/myapp
myenv                    /opt/anaconda3/envs/myenv

$ 

--
Grüße
Christoph
Benutzeravatar
ThomasL
User
Beiträge: 1366
Registriert: Montag 14. Mai 2018, 14:44
Wohnort: Kreis Unna NRW

certifi conda-forge::certifi-2021.10.8-py37hf~ --> pkgs/main::certifi-2021.10.8-py37hecd8cb5_2
conda conda-forge::conda-4.11.0-py37hf98548~ --> pkgs/main::conda-4.11.0-py37hecd8cb5_0
Es wurden Pakete für Python 3.7 installiert, wenn du Python startest, wird dir Python 3.8.11 angezeigt.
Du hast also mindestens 2 Python Versionen installiert.
Ich bin Pazifist und greife niemanden an, auch nicht mit Worten.
Für alle meine Code Beispiele gilt: "There is always a better way."
https://projecteuler.net/profile/Brotherluii.png
Krischu
User
Beiträge: 87
Registriert: Dienstag 14. Januar 2014, 09:07

ThomasL hat geschrieben: Dienstag 8. März 2022, 13:10
certifi conda-forge::certifi-2021.10.8-py37hf~ --> pkgs/main::certifi-2021.10.8-py37hecd8cb5_2
conda conda-forge::conda-4.11.0-py37hf98548~ --> pkgs/main::conda-4.11.0-py37hecd8cb5_0
Es wurden Pakete für Python 3.7 installiert, wenn du Python startest, wird dir Python 3.8.11 angezeigt.
Du hast also mindestens 2 Python Versionen installiert.
Ja, so scheint's zu sein.

Code: Alles auswählen

$ /Users/kuku/anaconda3/bin/python
Python 3.7.1 (default, Dec 14 2018, 13:28:58) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
$ which jupyter
/Users/kuku/anaconda3/bin/jupyter
$ 
Die mit pip3 installierten Module gingen alle nach /opt/anaconda3.

Jetzt müßte ich wissen, wie ich auf diese Installation umschalte. PATH vielleicht?
Ein fürchterliches Chaos.
Da steht erst mal im .bash_profile an erster Stelle:
export PATH="/Users/kuku/anaconda3/bin:$PATH"
dann folgt ein

Code: Alles auswählen

# added by Miniconda3 installer
export PATH="/Users/kuku/miniconda3/bin:$PATH"
# added by Anaconda3 2018.12 installer
export PATH="/Users/kuku/anaconda3/bin:$PATH"
# added by Anaconda3 2019.10 installer
export PATH="/Users/kuku/opt/anaconda3/bin:$PATH
# added by Anaconda3 2019.10 installer
export PATH="/opt/anaconda3/bin:$PATH
Welcher da wohl gewinnt?
--
Grüße
Christoph
Antworten