pypsa-eur environment installation: pip failed

155 views
Skip to first unread message

Hyemin Park

unread,
Nov 17, 2022, 6:21:13 PM11/17/22
to pypsa
Hello,

I am a PhD student and interested in decarbonization policy.

I use Windows and been trying multiple times this past few days installing the environment. Googled/Tried few tricks/Searched in this Group but I am getting the same errors every time and I would really appreciate some help.

Here is the errors:

Preparing transaction: done

Verifying transaction: done

Executing transaction: done

Installing pip dependencies: | Ran pip subprocess with arguments:-- 731.2MB / 731.2MB                           3m:11.8s

['C:\\Users\\hmpark\\Anaconda3\\envs\\pypsa-eur\\python.exe', '-m', 'pip', 'install', '-U', '-r', 'C:\\Users\\hmpark\\PATH\\ToPyPSA\\pypsa-eur\\envs\\condaenv.n7pg03yq.requirements.txt']

Pip subprocess output:

 

Pip subprocess error:

Traceback (most recent call last):

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\runpy.py", line 196, in _run_module_as_main

    return _run_code(code, main_globals, None,

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\envs\lib\runpy.py", line 86, in _run_code

    exec(code, run_globals)

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\__main__.py", line 29, in <module>

    from pip._internal.cli.main import main as _main

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>

    from pip._internal.cli.autocompletion import autocomplete

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>

    from pip._internal.cli.main_parser import create_main_parser

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\cli\main_parser.py", line 9, in <module>

    from pip._internal.build_env import get_runnable_pip

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\build_env.py", line 20, in <module>

    from pip._internal.cli.spinners import open_spinner

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\cli\spinners.py", line 9, in <module>

    from pip._internal.utils.logging import get_indentation

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\utils\logging.py", line 29, in <module>

    from pip._internal.utils.misc import ensure_dir

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\utils\misc.py", line 42, in <module>

    from pip._internal.locations import get_major_minor_version

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\locations\__init__.py", line 14, in <module>

    from . import _sysconfig

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\locations\_sysconfig.py", line 11, in <module>

    from .base import change_root, get_major_minor_version, is_osx_framework

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\locations\base.py", line 9, in <module>

    from pip._internal.utils import appdirs

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_internal\utils\appdirs.py", line 13, in <module>

    from pip._vendor import platformdirs as _appdirs

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_vendor\platformdirs\__init__.py", line 42, in <module>

    PlatformDirs = _set_platform_dir_class()  #: Currently active platform

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_vendor\platformdirs\__init__.py", line 21, in _set_platform_dir_class

    from pip._vendor.platformdirs.windows import Windows as Result

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\lib\site-packages\pip\_vendor\platformdirs\windows.py", line 3, in <module>

    import ctypes

  File "C:\Users\hmpark\Anaconda3\envs\pypsa-eur\env\lib\ctypes\__init__.py", line 8, in <module>

    from _ctypes import Union, Structure, Array

ImportError: DLL load failed while importing _ctypes: The specified module could not be found.

 

failed

 

CondaEnvException: Pip failed


Thank you!

Hye Min Park (Hey-Meen) She/Her
Doctoral Fellow 
Pardee RAND Graduate School 


Johannes Hampp

unread,
Nov 18, 2022, 3:22:04 AM11/18/22
to Hyemin Park, pypsa
Hi there,

this seems to be a error related to general platform libraries rather
than PyPSA-EUR.

Are you using conda and the environment.yaml file for creating the
environment?

Did you try:

* Creating a conda environment manually and installing a few
dependencies by hand using conda and pip? Does that work?
* Deleting and recreating the environment?
* Removing and reinstalling anaconda or try miniconda?

What we generally recommend for Windows users is to use WSL (Windows
Subsystem for Linux) to run PyPSA-EUR. You could also give that a try.

Best,
Johannes


Best regards,
Johannes Hampp (he/him)

Justus Liebig University Giessen (JLU)
Center for international Development and Environmental Research (ZEU)

mailto: johanne...@zeu.uni-giessen.de

Senckenbergstr. 3
DE-35392 Giessen
https://uni-giessen.de/zeu
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pypsa+un...@googlegroups.com
> <mailto:pypsa+un...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pypsa/d106c0b0-03ed-4f6c-aa3b-f3bfbe326e95n%40googlegroups.com <https://groups.google.com/d/msgid/pypsa/d106c0b0-03ed-4f6c-aa3b-f3bfbe326e95n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Max Parzen

unread,
Nov 19, 2022, 9:54:35 AM11/19/22
to pypsa
Hi everyone,

We are facing the same issue on PyPSA-Earth with a windows user.
Please keep us up to date on what solved the issue.

We are trying the following:
# 3 ideas how to fix the issues
1. run VS code from WSL (google: how to install WSL on Windows). To run VScode, open the WSL terminal and type code . which will open VScode. From there just run through the regular PyPSA-Earth installation instructions.
2. Comment out all pip installation from environement.yaml, and install pypsa-earth without the pip dependcies mamba env create -f envs/environment.yaml. Install afterwards each out commented by e.g. pip install git+https://github.com/davide-f/powerplantmatching.git@new_pypsa_africa#egg=powerplantmatching
3. upgrade windows 10 to windows 11 & try the regular environment installation (with old anaconda installation & maybe even from a new conda instllation)

Best wishes,

Max

Hyemin Park

unread,
Jan 7, 2023, 7:09:43 PM1/7/23
to pypsa
Thank you so much, Johannes and Max!

I tried all the suggested solutions (except for upgrading windows). Due to company's firewall and security stuffs, I wasn't able to make it work.. 
However, I got an access to AWS ubuntu server and was able to complete the installation! 

For creating environment, I was able to run using mambaforge (used wget and bash instead of using "conda install mamba -n base -c conda-forge"). This method was strongly recommended in the installation document: https://mamba.readthedocs.io/en/latest/installation.html.

I will be running tutorials in the next couple days. Wish me luck!

Hye Min Park (Hey-Meen)

Doctoral Fellow | Assistant Policy Researcher

Pardee RAND Graduate School | RAND Corporation

Max Parzen

unread,
Jan 8, 2023, 10:47:51 AM1/8/23
to Hyemin Park, pypsa
Good luck Hey Meen :) Using WSL (windows Subsystem for Linux) solved it for the other user with that error.

You received this message because you are subscribed to a topic in the Google Groups "pypsa" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pypsa/Gt6Va8hVT54/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pypsa+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pypsa/21ce13b2-59b6-47e5-9f86-b346dee7ca1en%40googlegroups.com.
--

--

Maximilian Parzen
PhD Candidate in Energy System Modelling | Energy Storage

Director of PyPSA meets Earth – A Gloabel Open Energy System Model Initiative

School of Engineering | University of Edinburgh

Tel: +49 (0)176 70889068Add me on LinkedIn | Skype: max.parzen

Image preview

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
Reply all
Reply to author
Forward
0 new messages