-1

so I'm unable to install pyGSL on windows 10. I got the error "ModuleNotFoundError: No module named 'gsl_site'". I don't know how to make it work.

Commande:

py -m pip install pygsl

Result:

Collecting pygsl
  Downloading pygsl-2.3.3.tar.gz (1.1 MB)
     ---------------------------------------- 1.1/1.1 MB 436.4 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [36 lines of output]
      Traceback (most recent call last):
        File "C:\Users\Alexandre\AppData\Local\Temp\pip-install-_8zrlxl_\pygsl_b673fc80c5014a2494d8c714935b4036\gsl_dist\gsl_Location.py", line 141, in __init__
          import gsl_site
      ModuleNotFoundError: No module named 'gsl_site'

I'om on window 10 with python 3.11

Commande:

py -m pip --version

Result:

pip 23.1.2 from "C:\Users\Alexandre\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip" (python 3.11)

Here some context: Everything starts from when I try to switch to Visual studio to Visual Code. I use Git to make the bridge with my code, but when I try to run the code the Visual code said the python extension doesn't support interpreter under version 3.7. So afther some research the best solution was to pass to an newer version. So I download the python 3.11 version and try to reinstall my package.

to solve the problem I also try to install manually by using the github reposity, but it also crash when I try to make the wrapper with the same error code.

Commande:

py -m setup.py gsl_wrappers

Result:

 Traceback (most recent call last):
      File "C:\Users\Alexandre\Downloads\pygsl-2.3.3.tar\pygsl-2.3.3\pygsl-2.3.3\gsl_dist\gsl_Location.py", line 141, in __init__
        import gsl_site
    ModuleNotFoundError: No module named 'gsl_site'

On the github it also mension that the setup.py need to a prefix path to install in a local location. I try to specify where my othe package are at my current location to transfer manually at my package location at: C:/[python path]\Python\Python311\Lib\site-packages

Here the commande line I use py -m setup.py gslwrapper --gsl-prefix=./site-package I got the same result.

I also Install the wheel package successfully and the swig package. Commande:

py -m pip install wheel

Result:

Collecting wheel
  Using cached wheel-0.41.1-py3-none-any.whl (64 kB)
Installing collected packages: wheel
Successfully installed wheel-0.41.1

Commande:

py -m pip install swig

Result:

Collecting swig
  Downloading swig-4.1.1-py2.py3-none-win_amd64.whl (2.5 MB)
     ---------------------------------------- 2.5/2.5 MB 2.1 MB/s eta 0:00:00
Installing collected packages: swig
Successfully installed swig-4.1.1

but it still got the same error. Commande:

py -m pip install pygsl

Result:

Collecting pygsl
      Using cached pygsl-2.3.3.tar.gz (1.1 MB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... error
      error: subprocess-exited-with-error
    
      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> [36 lines of output]
          Traceback (most recent call last):
            File "C:\Users\Alexandre\AppData\Local\Temp\pip-install-5pxaejea\pygsl_bcc64ddebb9c484bb1f3c936a047d6f0\gsl_dist\gsl_Location.py", line 141, in __init__
              import gsl_site
          ModuleNotFoundError: No module named 'gsl_site'

With the suggestion of stackoverflow I Also try to install pipenv without issue. So After the installation, I try to install pygsl with pipenv, but it also crash.

Commande:

py -m pipenv install pygsl

Result:

Creating a virtualenv for this project...
Pipfile: C:\Users\Alexandre\Downloads\pygsl-2.3.3.tar\pygsl-2.3.3\pygsl-2.3.3\Pipfile
Using default python from C:\Users\Alexandre\AppData\Local\Programs\Python\Python311\python.exe (3.11.4) to create virtualenv...
[==  ] Creating virtual environment...created virtual environment CPython3.11.4.final.0-64 in 3812ms
  creator CPython3Windows(dest=C:\Users\Alexandre\.virtualenvs\pygsl-2.3.3-HyV3ohdB, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\Alexandre\AppData\Local\pypa\virtualenv)
    added seed packages: pip==23.2.1, setuptools==68.0.0, wheel==0.41.1
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

Successfully created virtual environment!
Virtualenv location: C:\Users\Alexandre\.virtualenvs\pygsl-2.3.3-HyV3ohdB
Creating a Pipfile for this project...
Installing pygsl...
Resolving pygsl...
Adding pygsl to Pipfile's [packages] ...
Installation Succeeded
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
Resolving dependencies...
Locking Failed!
[    ] Locking...
ERROR:pip.subprocessor:[present-rich] Getting requirements to build wheel exited with 1
[ResolutionFailure]:   File "C:\Users\Alexandre\AppData\Roaming\Python\Python311\site-packages\pipenv\resolver.py", line 704, in _main
[ResolutionFailure]:       resolve_packages(
[ResolutionFailure]:   File "C:\Users\Alexandre\AppData\Roaming\Python\Python311\site-packages\pipenv\resolver.py", line 662, in resolve_packages
[ResolutionFailure]:       results, resolver = resolve(
[ResolutionFailure]:       ^^^^^^^^
[ResolutionFailure]:   File "C:\Users\Alexandre\AppData\Roaming\Python\Python311\site-packages\pipenv\resolver.py", line 642, in resolve
[ResolutionFailure]:       return resolve_deps(
[ResolutionFailure]:       ^^^^^^^^^^^^^
[ResolutionFailure]:   File "C:\Users\Alexandre\AppData\Roaming\Python\Python311\site-packages\pipenv\utils\resolver.py", line 1167, in resolve_deps
[ResolutionFailure]:       results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]:       ^^^^^^^^^^^^^^^^^^^^^^
[ResolutionFailure]:   File "C:\Users\Alexandre\AppData\Roaming\Python\Python311\site-packages\pipenv\utils\resolver.py", line 948, in actually_resolve_deps
[ResolutionFailure]:       resolver.resolve()
[ResolutionFailure]:   File "C:\Users\Alexandre\AppData\Roaming\Python\Python311\site-packages\pipenv\utils\resolver.py", line 690, in resolve
[ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv run pip install <requirement_name> to bypass this mechanism, then run $ pipenv graph to inspect the versions actually installed in the virtualenv.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: Getting requirements to build wheel exited with 1

Edite 1:

In this Link that Phd had recommand. So I learn 2 thing:

  1. I need to create gsl_site.py
  2. I will need to build GSL.

I was able to install pygsl with python3.6 in the file C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Lib\site-packages\pygsl\gsl_dist. So my thougth process was to reuse that file with some tweak. I copied the Code file in my pyGsl reposity pygsl-2.3.3\gsl_dist\gsl_site.py. I had my swig version that I download earlier.

here the code I have in mmy python file:

# Some systems do not provide gsl-config. So here the locations can be entered
# by hand.
import os

# The path to the directory where gsl is installed. Currently setup.py assumes
# that the include files are located in "prefix/include". 
prefix = os.path.join("C:\\", "OpenSource", "local")

cflags = "-g -I" + os.path.join(prefix, "include")

libs   = "-L" + os.path.join(prefix, "lib")+ " -lgsl -lgslcblas -lm"

# Enter the correct GSL versions by hand..
version = "2.4"

# swig_extension.py needs swig to generate the approbriate wrapper files. This
# variable only needs to be correct is you use USE_SWIG=1 in setup.py
swig = os.path.join("C:\\", "OpenSource", "swig", "swig-4.1.1", "swig")
#swig = os.path.join("C:\\", "Programs", "Swig", "SWIG-1.3.19", "swig")

I put the GSL version to 2.4 beacause it the one that I have with the version 3.6. I conclude that should be install on my computer.

So I retry the command:

py -m setup.py gslwrappers

and the result have change.

<swig_extension.SWIG_Extension('__callback') at 0x1aaa54e98d0>
Building testing ufuncs!
#29 extension modules
usage: -m [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: -m --help [cmd1 cmd2 ...]
   or: -m --help-commands
   or: -m cmd --help

error: invalid command 'gslwrappers'

So I try the command

py -m setup.py config

and the result was that:

INFO: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\OpenSource\local\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt /Tc_configtest.c /Fo_configtest.obj
_configtest.c
_configtest.c(1): fatal error C1083: Cannot open include file: 'gsl/gsl_multifit_nlin.h': No such file or directory
failure.
removing: _configtest.c _configtest.obj
compiling '_configtest.c':
#include <gsl/gsl_multifit_nlin.h>

int main () {
  gsl_multifit_fdfsolver_jac;
}

Also, I have like 30 more output like that but for the sake of readability. I have only put one. So I thought that because I don't have the GSL build on my computer. So I download the GSL 2.7.1 on this site web. I extract the file with 7-zip then I read the read me an Install file.

In the install file they said "cd' to the directory containing the package's source code and type ./configure' to configure the package for your system."

That is what I do:

cd C:\Users\Alexandre\Documents\gsl-latest.tar\gsl-latest\gsl-2.7.1
./configure

The result is that:

    '.' is not recognized as an internal or external command,
operable program or batch file.

It seems to be some bash command, but I use the windows cmd. Is that my error here? In the GitHub issue, it just give up and go on Ubuntu. I don't have the resources to do that. Any help to build the GSL or to correct the Pygsl will be appreciated.

Edit 2: Yup it was the wrong terminal so I use gitBash and got this:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a sed that does not truncate output... /usr/bin/sed
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-pc-mingw64
checking host system type... x86_64-pc-mingw64
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... -std=gnu11
checking whether gcc -std=gnu11 understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc -std=gnu11... gcc3
checking how to run the C preprocessor... gcc -std=gnu11 -E
checking whether ln -s works... no, using cp -pR
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc -std=gnu11... c:/sysgcc/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (c:/sysgcc/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /c/SysGCC/MinGW64/bin/nm -B
checking the name lister (/c/SysGCC/MinGW64/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-pc-mingw64 file names to x86_64-pc-mingw64 format... func_convert_file_msys_to_w32
checking how to convert x86_64-pc-mingw64 file names to toolchain format... func_convert_file_msys_to_w32
checking for c:/sysgcc/mingw64/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /c/SysGCC/MinGW64/bin/nm -B output from gcc -std=gnu11 object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... no
checking for as... as
checking for dlltool... (cached) dlltool
checking for objdump... (cached) objdump
checking for objdir... .libs
checking if gcc -std=gnu11 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu11 option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc -std=gnu11 PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc -std=gnu11 static flag -static works... yes
checking if gcc -std=gnu11 supports -c -o file.o... yes
checking if gcc -std=gnu11 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu11 linker (c:/sysgcc/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for size_t... yes
checking for working volatile... yes
checking for inline... inline
checking whether char is unsigned... no
checking for cos in -lm... yes
checking for GNU-style extern inline... no
checking for C99-style inline... yes
checking for ieeefp.h... no
checking for complex.h... yes
checking for vprintf... yes
checking for memcpy... yes
checking for memmove... yes
checking for strdup... yes
checking for strtol... yes
checking for strtoul... yes
checking for EXIT_SUCCESS and EXIT_FAILURE... yes
checking for cos in -lm... (cached) yes
checking for gcc -std=gnu11 options needed to detect all undeclared functions... none needed
checking whether feenableexcept is declared... no
checking whether fesettrapenable is declared... no
checking whether hypot is declared... yes
checking whether expm1 is declared... yes
checking whether acosh is declared... yes
checking whether asinh is declared... yes
checking whether atanh is declared... yes
checking whether ldexp is declared... yes
checking whether frexp is declared... yes
checking whether fprnd_t is declared... no
checking whether isinf is declared... yes
checking whether isfinite is declared... yes
checking whether finite is declared... yes
checking whether isnan is declared... yes
checking whether log1p is declared... yes
checking for long double stdio... no
checking for extended floating point registers... yes
checking for IEEE arithmetic interface type... unknown
checking for IEEE compiler flags... none
checking for IEEE comparisons... yes
checking for IEEE denormalized values... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating gsl_version.h
config.status: creating gsl.spec
config.status: creating blas/Makefile
config.status: creating block/Makefile
config.status: creating bspline/Makefile
config.status: creating bst/Makefile
config.status: creating cblas/Makefile
config.status: creating cdf/Makefile
config.status: creating cheb/Makefile
config.status: creating combination/Makefile
config.status: creating complex/Makefile
config.status: creating const/Makefile
config.status: creating deriv/Makefile
config.status: creating dht/Makefile
config.status: creating diff/Makefile
config.status: creating doc/Makefile
config.status: creating doc/examples/Makefile
config.status: creating eigen/Makefile
config.status: creating err/Makefile
config.status: creating fft/Makefile
config.status: creating filter/Makefile
config.status: creating fit/Makefile
config.status: creating gsl/Makefile
config.status: creating histogram/Makefile
config.status: creating ieee-utils/Makefile
config.status: creating integration/Makefile
config.status: creating interpolation/Makefile
config.status: creating linalg/Makefile
config.status: creating matrix/Makefile
config.status: creating min/Makefile
config.status: creating monte/Makefile
config.status: creating movstat/Makefile
config.status: creating multifit/Makefile
config.status: creating multifit_nlinear/Makefile
config.status: creating multilarge/Makefile
config.status: creating multilarge_nlinear/Makefile
config.status: creating multimin/Makefile
config.status: creating multiroots/Makefile
config.status: creating multiset/Makefile
config.status: creating ntuple/Makefile
config.status: creating ode-initval/Makefile
config.status: creating ode-initval2/Makefile
config.status: creating permutation/Makefile
config.status: creating poly/Makefile
config.status: creating qrng/Makefile
config.status: creating randist/Makefile
config.status: creating rng/Makefile
config.status: creating roots/Makefile
config.status: creating rstat/Makefile
config.status: creating siman/Makefile
config.status: creating sort/Makefile
config.status: creating spblas/Makefile
config.status: creating splinalg/Makefile
config.status: creating spmatrix/Makefile
config.status: creating specfunc/Makefile
config.status: creating statistics/Makefile
config.status: creating sum/Makefile
config.status: creating sys/Makefile
config.status: creating test/Makefile
config.status: creating utils/Makefile
config.status: creating vector/Makefile
config.status: creating wavelet/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: error: in `/c/Users/Alexandre/Documents/gsl-latest.tar/gsl-latest/gsl-2.7.1':
config.status: error: Something went wrong bootstrapping makefile fragments
    for automatic dependency tracking.  If GNU make was not used, consider
    re-running the configure script with MAKE="gmake" (or whatever is
    necessary).  You can also try re-running configure with the
    '--disable-dependency-tracking' option to at least be able to build
    the package (albeit without support for automatic dependency tracking).
See `config.log' for more details

I try to add MAKE="gmake" to the command but got the same result and config.log file has 1951 line any help to fix this will be appreciate.

  • https://github.com/pygsl/pygsl/issues/19#issuecomment-1294812067 , https://github.com/pygsl/pygsl/issues/27 – phd Aug 12 '23 at 01:07
  • https://meta.stackoverflow.com/a/285557/5586359 Text, please, no screenshots of text! http://idownvotedbecau.se/imageofcode. [Edit] your question, copy/paste from the terminal and properly [format](https://meta.stackoverflow.com/questions/251361/how-do-i-format-my-code-blocks) it as code. Images are not helpful, they're hard to read and hard to search. Badly formatted code is hard to read. Images are only good to show something non-textual (like colors, fonts, screen positions, etc). – phd Aug 12 '23 at 01:08
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 12 '23 at 10:01
  • 1
    Thank for the feedback I wasn't aware of this issue. I corrected my post. – Alexandre Morissette Aug 12 '23 at 20:58
  • @AlexandreMorissette Nice, tnx. I retracted my downvote. – phd Aug 12 '23 at 20:59

0 Answers0