Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conda package error during installation #205

Closed
okmechak opened this issue Oct 25, 2023 · 4 comments · Fixed by #236
Closed

Conda package error during installation #205

okmechak opened this issue Oct 25, 2023 · 4 comments · Fixed by #236
Assignees
Labels
conda-issue Issues related to the conda source of PyFMI.

Comments

@okmechak
Copy link

I am trying to install PyFMI on Ubuntu using conda.

at firs Ive instaled Cython 3.0.4 then cloned and compiled fmi-library:

# get FMIL and build it
git clone https://github.com/modelon-community/fmi-library
cd fmi-library
mkdir build-fmil
cd build-fmil
cmake -DFMILIB_INSTALL_PREFIX=/home/myUser/fmil ..
make install test
# now you should have the FMIL library in:
# /home/myUser/fmil
# export that to terminal before installing PyFMI
export FMIL_HOME=/home/myUser/fmil

And installation of PyFMI gives next error:

(GreenEnergy) southerncross@southerncross:~/Builds/fmi-library$ pip install pyfmi
Collecting pyfmi
  Using cached PyFMI-2.5.tar.gz (4.8 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [80 lines of output]
      /home/southerncross/anaconda3/envs/GreenEnergy/lib/python3.12/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-install-whektawf/pyfmi_778b59c1d9d54bfd986ae0020580f04d/src/pyfmi/fmi.pxd
        tree = Parsing.p_module(s, pxd, full_module_name)
      warning: src/pyfmi/fmil_import.pxd:59:4: 'size_t' redeclared
      warning: src/pyfmi/fmil_import.pxd:110:4: 'fmi2_variable_alias_kind_enu_t' redeclared
      warning: src/pyfmi/fmil_import.pxd:125:4: 'fmi2_base_type_enu_t' redeclared
      warning: src/pyfmi/fmil_import.pxd:152:4: 'fmi2_causality_enu_t' redeclared
      warning: src/pyfmi/fmil_import.pxd:164:4: 'fmi2_fmu_kind_enu_t' redeclared
      warning: src/pyfmi/fmil_import.pxd:179:4: 'fmi2_variability_enu_t' redeclared
      warning: src/pyfmi/fmil_import.pxd:189:4: 'fmi2_variable_naming_convension_enu_t' redeclared
      warning: src/pyfmi/fmil_import.pxd:223:4: 'fmi2_dependency_factor_kind_enu_t' redeclared
      warning: src/pyfmi/fmil_import.pxd:230:4: 'fmi2_initial_e.....

How to solve this problem?

Best regards,
Oleh

@modelonrobinandersson modelonrobinandersson self-assigned this Oct 25, 2023
@modelonrobinandersson
Copy link
Member

Hi @okmechak, can you try via conda-forge? See https://github.com/modelon-community/PyFMI#installation-using-conda

@modelonrobinandersson modelonrobinandersson added the conda-issue Issues related to the conda source of PyFMI. label Oct 25, 2023
@okmechak
Copy link
Author

Hi @okmechak, can you try via conda-forge? See https://github.com/modelon-community/PyFMI#installation-using-conda

Thx for reply. At first was not patient enough :) This command took me maybe 2hr to complete and here you can see result:

(GreenEnergy) southerncross@southerncross:~$ conda install -c conda-forge pyfmi
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: - 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                       

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - pyfmi -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0|3.4.*']

Your python: python=3.12

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.38=0
  - pyfmi -> libgcc-ng[version='>=10.3.0'] -> __glibc[version='>=2.17']
  - python=3.12 -> libgcc-ng[version='>=11.2.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.38

@modelonrobinandersson
Copy link
Member

Hi @okmechak, it looks like you are unable to install PyFMI as you are using Python 3.12. Currently we have not added support for Python 3.12 and it is a quite large effort due to deprecations in numpy.distutils. Are you able to switch to Python 3.11? It should work fine to install with Python 3.11.

@okmechak
Copy link
Author

Downgraded to 3.11 version of python and created new environment in conda and was able to install pyfmi. Thank you for help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conda-issue Issues related to the conda source of PyFMI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants