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

unable to install impedancefitter #245

Open
StefanPofahl opened this issue Nov 11, 2022 · 17 comments
Open

unable to install impedancefitter #245

StefanPofahl opened this issue Nov 11, 2022 · 17 comments
Labels
bug Something isn't working

Comments

@StefanPofahl
Copy link

I fail to install the PyPy-package ImpedanceFitter.
I also tried in Julia RC v.1.8.3.
Here my commands:

import Pkg; Pkg.add("CondaPkg")
import Pkg; Pkg.add("PythonCall")
impfit = PythonCall.pyimport("impedancefitter")

and here is the error output on my machine:

The environment can't be solved, aborting the operation
error    libmamba Could not solve for environment specs
critical libmamba UnsatisfiableError
ERROR: failed process: Process(`'C:\Users\stefanpofahl\.julia\artifacts\7950c161b9c76ecc6d58b2b6734696fee7d8e4a0\Library\bin\micromamba.exe' -r 'C:\Users\stefanpofahl\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root' create -y -p 'C:\Users\stefanpofahl\.julia\environments\v1.9\.CondaPkg\env' --override-channels --no-channel-priority "impedancefitter[version='*']" "python[version='>=3.7,<4',channel='conda-forge',build='*cpython*']" -c conda-forge`, ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:480
  [3] run(::Cmd)
    @ Base .\process.jl:477
  [4] _run(io::IO, cmd::Cmd, args::Any; flags::Any)
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\resolve.jl:301
  [5] _resolve_conda_install(io::Any, conda_env::Any, specs::Any, channels::Any; create::Any)
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\resolve.jl:202
  [6] resolve(; force::Bool, io::IO, interactive::Bool, dry_run::Bool)
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\resolve.jl:452
  [7] resolve()
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\resolve.jl:315
  [8] add(pkgs::AbstractVector; resolve::Any, file::Any, temp::Any)
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\deps.jl:244
  [9] add(pkgs::AbstractVector)
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\deps.jl:231
 [10] add(pkg::Union{CondaPkg.ChannelSpec, CondaPkg.PipPkgSpec, CondaPkg.PkgSpec}; kw::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\deps.jl:248
 [11] add(pkg::Union{CondaPkg.ChannelSpec, CondaPkg.PipPkgSpec, CondaPkg.PkgSpec})
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\deps.jl:248
 [12] add(pkg::AbstractString; version::Any, channel::Any, build::Any, kw::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\deps.jl:375
 [13] add(pkg::AbstractString)
    @ CondaPkg C:\Users\stefanpofahl\.julia\packages\CondaPkg\RuSdR\src\deps.jl:375
 [14] top-level scope
    @ REPL[6]:1

Do you have asuggestion?

@cjdoris
Copy link
Collaborator

cjdoris commented Nov 17, 2022

You tried to install impedancefitter as a Conda package, but it is not on Conda, it is only on PyPI. Therefore you need to add it as a pip package, e.g. pkg> conda pip_add impedancefitter or CondaPkg.add_pip("impedancefitter").

@cjdoris cjdoris closed this as completed Nov 17, 2022
@StefanPofahl
Copy link
Author

unfortunatly it does not work for me, at least under Ubuntu:

The environment can't be solved, aborting the operation
error    libmamba Could not solve for environment specs
critical libmamba UnsatisfiableError
ERROR: failed process: Process(`/home/stefan/.julia/artifacts/6e6d5245d8ef7b40183c446606c8b1590c0788f1/bin/micromamba -r /home/stefan/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root install -y -p /home/stefan/.julia/environments/v1.6/.CondaPkg/env --override-channels --no-channel-priority "impedance[version='*']" "pip[version='>=22.0.0']" "python[version='>=3.7,<4',channel='conda-forge',build='*cpython*']" -c conda-forge`, ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:538 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:453
  [3] run(::Cmd)
    @ Base ./process.jl:451
  [4] _run(io::IO, cmd::Cmd, args::Any; flags::Any)
    @ CondaPkg ~/.julia/packages/CondaPkg/RuSdR/src/resolve.jl:301
  [5] _resolve_conda_install(io::Any, conda_env::Any, specs::Any, channels::Any; create::Any)
    @ CondaPkg ~/.julia/packages/CondaPkg/RuSdR/src/resolve.jl:202
  [6] _resolve_conda_install(io::Any, conda_env::Any, specs::Any, channels::Any)
    @ CondaPkg ~/.julia/packages/CondaPkg/RuSdR/src/resolve.jl:192
  [7] resolve(; force::Bool, io::IO, interactive::Bool, dry_run::Bool)
    @ CondaPkg ~/.julia/packages/CondaPkg/RuSdR/src/resolve.jl:433
  [8] resolve()
    @ CondaPkg ~/.julia/packages/CondaPkg/RuSdR/src/resolve.jl:317
  [9] add(pkgs::AbstractVector{T} where T; resolve::Any, file::Any, temp::Any)
    @ CondaPkg ~/.julia/packages/CondaPkg/RuSdR/src/deps.jl:244
 [10] add(pkgs::AbstractVector{T} where T)
    @ CondaPkg ~/.julia/packages/CondaPkg/RuSdR/src/deps.jl:232
 [11] pip_add(args::Vector{String}; binary::String)
    @ CondaPkg.PkgREPL ~/.julia/packages/CondaPkg/RuSdR/src/PkgREPL.jl:164
 [12] pip_add(args::Vector{String})
    @ CondaPkg.PkgREPL ~/.julia/packages/CondaPkg/RuSdR/src/PkgREPL.jl:164
 [13] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
    @ Pkg.REPLMode /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/REPLMode/REPLMode.jl:408
 [14] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
    @ Pkg.REPLMode /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/REPLMode/REPLMode.jl:386
 [15] do_cmd
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/REPLMode/REPLMode.jl:377 [inlined]
 [16] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Pkg.REPLMode /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/REPLMode/REPLMode.jl:550
 [17] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [18] invokelatest
    @ ./essentials.jl:706 [inlined]
 [19] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/LineEdit.jl:2441
 [20] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:1126
 [21] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:417

@cjdoris
Copy link
Collaborator

cjdoris commented Nov 17, 2022

You also need to remove the Conda package you added before: pkg> conda rm impedancefitter.

@StefanPofahl
Copy link
Author

Thanks for your support :-)
I have tried your approach, with a restart in-between.
First removal with Conda. Re-Start of Julia. Installation via CondaPkg.
Unfortunately, it does not work on MS-Windows nor on on Linux / Unbuntu

@cjdoris
Copy link
Collaborator

cjdoris commented Nov 17, 2022

Please send me a sequence of steps I can run to reproduce the error.

@StefanPofahl
Copy link
Author

import Conda
Conda.rm("impedancefitter")
restart
import CondaPkg
CondaPkg.add_pip("impedancefitter")

Meanwhile, I tried another time and now the error message is gone under MS-windows :-)

@StefanPofahl
Copy link
Author

Installation seemed to work under MS-Win, but the following command
impfit = PythonCall.pyimport("impedancefitter")
gave this error:

Python: ImportError: DLL load failed while importing _common: Die angegebene Prozedur wurde nicht gefunden.
pythrow() at err.jl:94
errcheck at err.jl:10 [inlined]
pyimport(m::String) at import.jl:11
top-level scope at example_impedancefitter.jl:53
eval at boot.jl:368 [inlined]

@cjdoris cjdoris reopened this Nov 18, 2022
@cjdoris cjdoris added the bug Something isn't working label Nov 18, 2022
@cjdoris
Copy link
Collaborator

cjdoris commented Nov 18, 2022

OK I can reproduce that error on Windows.

Steps to reproduce:

julia --project=@issue245
] add CondaPkg PythonCall
using CondaPkg
] conda pip_add impedancefitter
using PythonCall
pyimport("impedancefitter")

Error:

ERROR: Python: ImportError: DLL load failed while importing _common: The specified procedure could not be found.
Python stacktrace:
 [1] <module>
   @ C:\Users\chris\.julia\environments\issue245\.CondaPkg\env\Lib\site-packages\openturns\common.py:15
 [2] <module>
   @ C:\Users\chris\.julia\environments\issue245\.CondaPkg\env\Lib\site-packages\openturns\__init__.py:49
 [3] <module>
   @ C:\Users\chris\.julia\environments\issue245\.CondaPkg\env\Lib\site-packages\impedancefitter\postprocess.py:22
 [4] <module>
   @ C:\Users\chris\.julia\environments\issue245\.CondaPkg\env\Lib\site-packages\impedancefitter\__init__.py:38
Stacktrace:
 [1] pythrow()
   @ PythonCall C:\Users\chris\.julia\packages\PythonCall\Td3SH\src\err.jl:94
 [2] errcheck
   @ C:\Users\chris\.julia\packages\PythonCall\Td3SH\src\err.jl:10 [inlined]
 [3] pyimport(m::String)
   @ PythonCall C:\Users\chris\.julia\packages\PythonCall\Td3SH\src\concrete\import.jl:11
 [4] top-level scope
   @ REPL[2]:1

It looks like it cannot open ...\site-packages\openturns\_common.pyd. Indeed, this cannot be opened with dlopen either, the following produces the same message "The specified procedure could not be found":

using Libdl
dlopen(raw"C:\Users\chris\.julia\environments\issue245\.CondaPkg\env\Lib\site-packages\openturns\_common.pyd")

Presumably there is some DLL somewhere that Windows can't find for some reason. Will need to investigate.

@cjdoris
Copy link
Collaborator

cjdoris commented Nov 18, 2022

The error does not occur when doing import impedancefitter from the Python REPL (in the same Conda environment). Hence this really is a bug in PythonCall.

The same error occurs in PyCall by doing:

] add Conda PyCall
using Conda
Conda.pip("install", "impedancefitter")
using PyCall
pyimport("impedancefitter")

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2023

This issue has been marked as stale because it has been open for 30 days with no activity. If the issue is still relevant then please leave a comment, or else it will be closed in 7 days.

@github-actions github-actions bot added the stale Issues about to be auto-closed label Sep 3, 2023
@StefanPofahl
Copy link
Author

Last time I tested it, it was still relevant ...
I have put it on my todo-list to test again.

@github-actions github-actions bot removed the stale Issues about to be auto-closed label Sep 5, 2023
@StefanPofahl
Copy link
Author

You can close the issue. I was able to start the package.

@cjdoris
Copy link
Collaborator

cjdoris commented Sep 13, 2023

It works now? What changed?

@StefanPofahl
Copy link
Author

Thanks for your response, sorry I made a mistake, I was able to install it via PyCall.

The installation under Linux in combination with PythonCall still fails :-(

My Julia is:

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, haswell)
  Threads: 1 on 8 virtual cores

Which method for installation do you prefer, add or add_pip?
A

import CondaPkg; CondaPkg.add("impedancefitter")

B

import CondaPkg; CondaPkg.add_pip("impedancefitter")

Which environment variables and constants should I check, when working with PythonCall?
To get started with impedancefitter under PyCall I needed to run the following once:

    ENV["CONDA_JL_HOME"] = "/home/user_account_name/.julia/conda/3"
    const Conda.ROOTENV = "/home/user_account_name/.julia/conda/3"
    import Pkg; Pkg.build("PyCall") # this will (re-)build as well "Conda"
    exit()

Note: The Conda path above is an example, please check what makes sense on your machine.

@cjdoris
Copy link
Collaborator

cjdoris commented Sep 14, 2023

Option B. Like I said above, that package is not available from Conda, only Pip.

I'm surprised it worked with PyCall - I got the same error last time I tried.

@StefanPofahl
Copy link
Author

Ok, the issue does still exist under Linux :-(

@StefanPofahl
Copy link
Author

I have worked further on the issue and you are right, also under PyCall you need to install via pip, see here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants