GithubHelp home page GithubHelp logo

import leaptorch error about leap HOT 6 CLOSED

junbopeng avatar junbopeng commented on May 30, 2024
import leaptorch error

from leap.

Comments (6)

kylechampley avatar kylechampley commented on May 30, 2024

My best guess is that the install failed. Could you send me the full traceback?

from leap.

junbopeng avatar junbopeng commented on May 30, 2024

My best guess is that the install failed. Could you send me the full traceback?

I followed the instructions here.


import leaptorch
Error: could not find LEAP dynamic library at
/home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages/libleap.so
or
/home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages/../build/lib/libleap.so
Traceback (most recent call last):
File "", line 1, in
File "/home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages/leaptorch.py", line 13, in
lct = tomographicModels()
File "/home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages/leapctype.py", line 137, in init
self.param_id = self.create_new_model()
File "/home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages/leapctype.py", line 149, in create_new_model
self.libprojectors.create_new_model.restype = ctypes.c_int
AttributeError: 'NoneType' object has no attribute 'create_new_model'


And the leapctype could be imported.

from leap.

kylechampley avatar kylechampley commented on May 30, 2024

Yep, it looks like dynamic library failed to compile. A couple of things to check

  1. Do you have all the dependencies met? They are listed here: https://github.com/LLNL/LEAP/wiki/Installing-and-Using-LEAP
  2. Trying running the following command which should print out all the compilation errors: pip install -v .
  3. I precompiled the dynamic libraries for version 1.0, you can just download them here: https://github.com/LLNL/LEAP/releases
  4. One common error in the compilation is a CMake error. A change that helped another user is listed here: #9 (comment)

from leap.

junbopeng avatar junbopeng commented on May 30, 2024

Yep, it looks like dynamic library failed to compile. A couple of things to check

  1. Do you have all the dependencies met? They are listed here: https://github.com/LLNL/LEAP/wiki/Installing-and-Using-LEAP
  2. Trying running the following command which should print out all the compilation errors: pip install -v .
  3. I precompiled the dynamic libraries for version 1.0, you can just download them here: https://github.com/LLNL/LEAP/releases
  4. One common error in the compilation is a CMake error. A change that helped another user is listed here: encountered an error while running the demo #9 (comment)

I reinstalled the leap and encountered the same error in import leaptorch.

It seems that the installation is complete:

(py39) jp_peng@sn4622118213:~/Documents/DECBCT_unsup/LEAP$ pip install -v .
Using pip 23.3.1 from /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages/pip (python 3.9)
Processing /home/jp_peng/Documents/DECBCT_unsup/LEAP
Running command python setup.py egg_info
./etc/build.sh: 13: cmake: not found
/home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages/setuptools/dist.py:498: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

      ********************************************************************************
      Usage of dash-separated 'description-file' will not be supported in future
      versions. Please use the underscore name 'description_file' instead.

      This deprecation is overdue, please update your project and remove deprecated
      calls to avoid build errors in the future.

      See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
      ********************************************************************************

!!
opt = self.warn_dash_deprecation(opt, section)
running egg_info
creating /tmp/pip-pip-egg-info-96dd29l4/leapct.egg-info
writing /tmp/pip-pip-egg-info-96dd29l4/leapct.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-96dd29l4/leapct.egg-info/dependency_links.txt
writing requirements to /tmp/pip-pip-egg-info-96dd29l4/leapct.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-96dd29l4/leapct.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-96dd29l4/leapct.egg-info/SOURCES.txt'
reading manifest file '/tmp/pip-pip-egg-info-96dd29l4/leapct.egg-info/SOURCES.txt'
writing manifest file '/tmp/pip-pip-egg-info-96dd29l4/leapct.egg-info/SOURCES.txt'
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from leapct==1.0) (1.26.3)
Requirement already satisfied: torch in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from leapct==1.0) (2.1.2)
Requirement already satisfied: filelock in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from torch->leapct==1.0) (3.13.1)
Requirement already satisfied: typing-extensions in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from torch->leapct==1.0) (4.9.0)
Requirement already satisfied: sympy in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from torch->leapct==1.0) (1.12)
Requirement already satisfied: networkx in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from torch->leapct==1.0) (3.1)
Requirement already satisfied: jinja2 in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from torch->leapct==1.0) (3.1.2)
Requirement already satisfied: fsspec in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from torch->leapct==1.0) (2023.12.2)
Requirement already satisfied: MarkupSafe>=2.0 in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from jinja2->torch->leapct==1.0) (2.1.3)
Requirement already satisfied: mpmath>=0.19 in /home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages (from sympy->torch->leapct==1.0) (1.3.0)
Building wheels for collected packages: leapct
Running command python setup.py bdist_wheel
./etc/build.sh: 13: cmake: not found
/home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages/setuptools/dist.py:498: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

      ********************************************************************************
      Usage of dash-separated 'description-file' will not be supported in future
      versions. Please use the underscore name 'description_file' instead.

      This deprecation is overdue, please update your project and remove deprecated
      calls to avoid build errors in the future.

      See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
      ********************************************************************************

!!
opt = self.warn_dash_deprecation(opt, section)
running bdist_wheel
running build
running build_py
creating build/lib
copying src/leaptorch.py -> build/lib
copying src/leapctype.py -> build/lib
/home/jp_peng/.conda/envs/py39/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

      ********************************************************************************
      Please avoid running ``setup.py`` directly.
      Instead, use pypa/build, pypa/installer or other
      standards-based tools.

      See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
      ********************************************************************************

!!
self.initialize_options()
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
copying build/lib/leapctype.py -> build/bdist.linux-x86_64/wheel
copying build/lib/leaptorch.py -> build/bdist.linux-x86_64/wheel
running install_egg_info
running egg_info
creating src/leapct.egg-info
writing src/leapct.egg-info/PKG-INFO
writing dependency_links to src/leapct.egg-info/dependency_links.txt
writing requirements to src/leapct.egg-info/requires.txt
writing top-level names to src/leapct.egg-info/top_level.txt
writing manifest file 'src/leapct.egg-info/SOURCES.txt'
reading manifest file 'src/leapct.egg-info/SOURCES.txt'
writing manifest file 'src/leapct.egg-info/SOURCES.txt'
Copying src/leapct.egg-info to build/bdist.linux-x86_64/wheel/leapct-1.0-py3.9.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/leapct-1.0.dist-info/WHEEL
creating '/tmp/pip-wheel-bqy16jhg/leapct-1.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'leapctype.py'
adding 'leaptorch.py'
adding 'leapct-1.0.dist-info/METADATA'
adding 'leapct-1.0.dist-info/WHEEL'
adding 'leapct-1.0.dist-info/top_level.txt'
adding 'leapct-1.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Building wheel for leapct (setup.py) ... done
Created wheel for leapct: filename=leapct-1.0-py3-none-any.whl size=27450 sha256=07f591e9b39a67899ee488b51c5ddf5241af41d4205d4b2651735f4b242e8cbc
Stored in directory: /tmp/pip-ephem-wheel-cache-8vgl3igw/wheels/0e/f9/1b/fe1249fe8768085c66444dc1f522370c4ea10bfba6fd055a76
Successfully built leapct
Installing collected packages: leapct
Successfully installed leapct-1.0

from leap.

kylechampley avatar kylechampley commented on May 30, 2024

Unfortunately, it always says "Successfully installed leapct..." even though it is not successful.

Anyway, if you look at the output you posted you can see that it says "./etc/build.sh: 13: cmake: not found"

For some reason your system cannot find cmake. This is what is causing your issues and you'll have to resolve this. Again, you can always use the precompiled library if you are still having trouble.

from leap.

junbopeng avatar junbopeng commented on May 30, 2024

Unfortunately, it always says "Successfully installed leapct..." even though it is not successful.

Anyway, if you look at the output you posted you can see that it says "./etc/build.sh: 13: cmake: not found"

For some reason your system cannot find cmake. This is what is causing your issues and you'll have to resolve this. Again, you can always use the precompiled library if you are still having trouble.

Thanks for your help! I reinstalled cmake and leapct, seems working now.

from leap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.