Repository navigation
Noo module named slycot #63
Description
Activity
pip install cmake
Probably isn't doing what you think it should. You should
apt install cmake.I take that back. It actually seems like cmake is packaged for installation via pypi: https://pypi.org/project/cmake/
I also tried to install slycot from source which leads to the same issue.
Cmake is of course installed on my system.Are you sure you have installed the package into a directory that is on your path? Are you trying to import from the same Python executable that the package was installed alongside?
I fixed that, because I had the same issue : #62
Ah-ha; the files have been installed in "slycot" off the virtual-env root, rather than in site-packages; I remember this happening on Windows when I was trying to build wheels there, but I thought it was a peculiarity of that environment. The result below is from an Ubuntu 18.04 system.
If anyone knows why this would happen, please speak up. Do we need to teach scikit-build or CMake about the "normal" install directories, maybe?
(slycot-via-pip) rory@rory-latitude:~$ pip show -f slycot Name: slycot Version: 0.3.4 Summary: Slycot: a wrapper for the SLICOT control and systems library Home-page: https://github.com/python-control/Slycot Author: Enrico Avventi et al. Author-email: None License: GPL-2.0 Location: /home/rory/.miniconda3/envs/slycot-via-pip/lib/python3.7/site-packages Requires: Required-by: Files: ../../../slycot/__init__.py ../../../slycot/__pycache__/__init__.cpython-37.pyc ../../../slycot/__pycache__/analysis.cpython-37.pyc ../../../slycot/__pycache__/examples.cpython-37.pyc ../../../slycot/__pycache__/math.cpython-37.pyc ../../../slycot/__pycache__/synthesis.cpython-37.pyc ../../../slycot/__pycache__/transform.cpython-37.pyc ../../../slycot/__pycache__/version.cpython-37.pyc ../../../slycot/_wrapper.so ../../../slycot/analysis.py ../../../slycot/examples.py ../../../slycot/math.py ../../../slycot/synthesis.py ../../../slycot/tests/__init__.py ../../../slycot/tests/__pycache__/__init__.cpython-37.pyc ../../../slycot/tests/__pycache__/test.cpython-37.pyc ../../../slycot/tests/__pycache__/test_sg02ad.cpython-37.pyc ../../../slycot/tests/__pycache__/test_sg03ad.cpython-37.pyc ../../../slycot/tests/__pycache__/test_tb05ad.cpython-37.pyc ../../../slycot/tests/__pycache__/test_td04ad.cpython-37.pyc ../../../slycot/tests/test.py ../../../slycot/tests/test_sg02ad.py ../../../slycot/tests/test_sg03ad.py ../../../slycot/tests/test_tb05ad.py ../../../slycot/tests/test_td04ad.py ../../../slycot/transform.py ../../../slycot/version.py slycot-0.3.4.dist-info/COPYING slycot-0.3.4.dist-info/INSTALLER slycot-0.3.4.dist-info/METADATA slycot-0.3.4.dist-info/RECORD slycot-0.3.4.dist-info/WHEEL slycot-0.3.4.dist-info/top_level.txt (slycot-via-pip) rory@rory-latitude:~$ python -c "import sys; print(sys.path)" ['', '/home/rory/.miniconda3/envs/slycot-via-pip/lib/python37.zip', '/home/rory/.miniconda3/envs/slycot-via-pip/lib/python3.7', '/home/rory/.miniconda3/envs/slycot-via-pip/lib/python3.7/lib-dynload', '/home/rory/.miniconda3/envs/slycot-via-pip/lib/python3.7/site-packages']With the diff below, I can build a wheel (
python setup.py bdist_wheel), install it (pip install slycot-0.3.4.9-cp37-cp37m-linux_x86_64.whl), and thenimport slycotworks, andpip show -f slycotisName: slycot Version: 0.3.4.9 Summary: Slycot: a wrapper for the SLICOT control and systems library Home-page: https://github.com/python-control/Slycot Author: Enrico Avventi et al. Author-email: None License: GPL-2.0 Location: /home/rory/.miniconda3/envs/slycot-via-pip/lib/python3.7/site-packages Requires: Required-by: Files: slycot-0.3.4.9.dist-info/COPYING slycot-0.3.4.9.dist-info/INSTALLER slycot-0.3.4.9.dist-info/METADATA slycot-0.3.4.9.dist-info/RECORD slycot-0.3.4.9.dist-info/WHEEL slycot-0.3.4.9.dist-info/top_level.txt slycot/__init__.py slycot/__pycache__/__init__.cpython-37.pyc slycot/__pycache__/analysis.cpython-37.pyc slycot/__pycache__/examples.cpython-37.pyc slycot/__pycache__/math.cpython-37.pyc slycot/__pycache__/synthesis.cpython-37.pyc slycot/__pycache__/transform.cpython-37.pyc slycot/__pycache__/version.cpython-37.pyc slycot/_wrapper.so slycot/analysis.py slycot/examples.py slycot/math.py slycot/synthesis.py slycot/tests/__init__.py slycot/tests/__pycache__/__init__.cpython-37.pyc slycot/tests/__pycache__/test.cpython-37.pyc slycot/tests/__pycache__/test_sg02ad.cpython-37.pyc slycot/tests/__pycache__/test_sg03ad.cpython-37.pyc slycot/tests/__pycache__/test_tb05ad.cpython-37.pyc slycot/tests/__pycache__/test_td04ad.cpython-37.pyc slycot/tests/test.py slycot/tests/test_sg02ad.py slycot/tests/test_sg03ad.py slycot/tests/test_tb05ad.py slycot/tests/test_td04ad.py slycot/transform.py slycot/version.pydiff --git a/CMakeLists.txt b/CMakeLists.txt index 63b32e0..67973f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,8 @@ endif() project(slycot VERSION ${SLYCOT_VERSION} LANGUAGES NONE) +find_package(PythonExtensions REQUIRED) + # Fortran detection fails on windows, use the CMAKE_C_SIMULATE flag to # force success if(WIN32) diff --git a/slycot/CMakeLists.txt b/slycot/CMakeLists.txt index 3207d92..7d8c377 100644 --- a/slycot/CMakeLists.txt +++ b/slycot/CMakeLists.txt @@ -3,7 +3,6 @@ # # RvP, 180710 - set(FSOURCES src/AB01MD.f src/MA02AD.f src/MB03YT.f src/NF01BW.f src/SB10KD.f @@ -166,7 +165,7 @@ target_include_directories( ${PYTHON_INCLUDE_DIRS} ) -install(TARGETS ${SLYCOT_MODULE} DESTINATION slycot) -install(FILES ${PYSOURCE} DESTINATION slycot) +install(TARGETS ${SLYCOT_MODULE} DESTINATION ${PYTHON_RELATIVE_SITE_PACKAGES_DIR}/slycot) +install(FILES ${PYSOURCE} DESTINATION ${PYTHON_RELATIVE_SITE_PACKAGES_DIR}/slycot) add_subdirectory(tests) diff --git a/slycot/tests/CMakeLists.txt b/slycot/tests/CMakeLists.txt index c97cb50..7de8521 100644 --- a/slycot/tests/CMakeLists.txt +++ b/slycot/tests/CMakeLists.txt @@ -3,4 +3,4 @@ set(PYSOURCE __init__.py test.py test_sg02ad.py test_sg03ad.py test_tb05ad.py test_td04ad.py) -install(FILES ${PYSOURCE} DESTINATION slycot/tests) +install(FILES ${PYSOURCE} DESTINATION ${PYTHON_RELATIVE_SITE_PACKAGES_DIR}/slycot/tests)
Hi,
I recently tried to install slycot via pip. Before that I installed the following dependencies:
Everything installs without any errors, but when I am trying to import slycot, I get the following error message:
ModuleNotFoundError: No module named 'slycot'Am I missing something?