question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update `scipy/__config__.py` to contain useful information

See original GitHub issue

Describe your issue.

Just as the title suggests, on Windows when the username contains a single quote, importing the scipy package would cause an error.

Reproducing Code Example

python -c "import scipy"

Error message

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Praxelogist's Lab\.conda\envs\losthub\lib\site-packages\scipy\__init__.py", line 134, in <module>
    from scipy.__config__ import show as show_config
  File "C:\Users\Praxelogist's Lab\.conda\envs\losthub\lib\site-packages\scipy\__config__.py", line 27
    lapack_info={'libraries': ['lapack', 'blas', 'lapack', 'blas'], 'library_dirs': ['C:/Users/Praxelogist's Lab/.conda/envs/losthub\\Library\\lib'], 'language': 'f77'}
                                                                                                           ^
SyntaxError: invalid syntax

SciPy/NumPy/Python version information

numpy==1.23.1 python==3.9.13 scipy==1.9.0

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
eli-schwartzcommented, Oct 19, 2022

You can get the compilers with:

comp.get_id()
comp.get_linker_id()
comp.version()
comp.cmd_array()

You can get the OS and CPU type with:

host_machine.cpu()
host_machine.cpu_family()

For build dependencies, you can push them to an array when looking them up, then iterate over them and check:

dep.name()
dep.found()
dep.version()

For the found version of Python, I think the primary useful information shown in the debug log is the path, anyway, right? So,

py_installation.path()

By the way, you can also use

py_installation.get_path('xxx')
py_installation.get_variable('xxx')

to get arbitrary sysconfig paths and config_vars, respectively, from that found python installation.

The one thing missing here is user-specified Build Options: xxx. By coincidence, someone else has proposed the same feature at https://github.com/mesonbuild/meson/issues/10898 and there’s a linked PR to implement it as well.

0reactions
rgommerscommented, Dec 19, 2022

This is now in progress for NumPy: https://github.com/numpy/numpy/pull/22769. So probably best to finish it there, and then sync whatever comes out to SciPy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segfault when trying to run tests locally #1197 - qutip ... - GitHub
In my tries yesterday, I did not have problem with scipy.linalg.eigh for C array. Since scipy does not use the same lapack interface...
Read more >
Scipy and CX_freeze - Error importing scipy: you cannot ...
i have had the same issue. I added this code to the setup.py generated by cx_freeze: import scipy includefiles_list=[] scipy_path = dirname(scipy.
Read more >
[Buildroot] [PATCH v5 1/4] package/python-gast: new host-only ...
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as...
Read more >
[v5,4/4] package/python-scipy: new package - Patchwork
Add host-meson and host-python-pythran dependencies. ... 106 insertions(+) create mode 100644 package/python-scipy/Config.in create mode ...
Read more >
[SciPy-dev] distutils and persistent system information
I have a question on how do get something optimally working for SciPy. ... specific information would be a good idea. ... import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found