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

The slipcover.tracker module seems to be unimportable when using the Windows py38 binary wheel on Windows 10 #5

Closed
exarkun opened this issue Apr 27, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@exarkun
Copy link

exarkun commented Apr 27, 2022

I created a new virtualenv using Python 3.8 on Windows 10 and installed slipcover into it, using the wheel from PyPI.

On running python -m slipcover

Traceback (most recent call last):
  File "C:\Users\vagrant\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\vagrant\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\vagrant\py38\lib\site-packages\slipcover\__main__.py", line 4, in <module>
    from slipcover import slipcover as sc
  File "C:\Users\vagrant\py38\lib\site-packages\slipcover\slipcover.py", line 8, in <module>
    from . import tracker
ImportError: DLL load failed while importing tracker: The specified module could not be found.

The tracker module exists in the filesystem:

(py38) PS C:\Users\vagrant> dir .\py38\lib\site-packages\slipcover\


    Directory: C:\Users\vagrant\py38\lib\site-packages\slipcover


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         4/27/2022  11:17 PM                __pycache__
-a----         4/27/2022  11:17 PM          27122 slipcover.py
-a----         4/27/2022  11:17 PM          14848 tracker.pyd
-a----         4/27/2022  11:17 PM              0 __init__.py
-a----         4/27/2022  11:17 PM           7287 __main__.py
@jaltmayerpizzorno jaltmayerpizzorno self-assigned this Apr 28, 2022
@jaltmayerpizzorno jaltmayerpizzorno added the bug Something isn't working label Apr 29, 2022
@jaltmayerpizzorno
Copy link
Collaborator

Yup, it looks so far like the wheels aren't being built right. I'll keep working on this, but it may be best for you to install from source for now (you can use pip3 install --no-binary :all: slipcover for that).

@jaltmayerpizzorno
Copy link
Collaborator

@exarkun Could you please try pip install -i https://test.pypi.org/simple/ slipcover==0.1.2.dev202204290945 and let me know if that works for you?

@exarkun
Copy link
Author

exarkun commented Apr 29, 2022

Unfortunately still not -

(py38) PS C:\Users\vagrant> pip uninstall slipcover
WARNING: Skipping slipcover as it is not installed.
(py38) PS C:\Users\vagrant> pip install -i https://test.pypi.org/simple/ slipcover==0.1.2.dev202204290945        Looking in indexes: https://test.pypi.org/simple/
Collecting slipcover==0.1.2.dev202204290945
  Downloading https://test-files.pythonhosted.org/packages/d7/a9/e4864af476d5415e8cc201448625c50904693e60b7a4d67695168d6da191/slipcover-0.1.2.dev202204290945-cp38-cp38-win_amd64.whl (25 kB)
Requirement already satisfied: tabulate in c:\users\vagrant\py38\lib\site-packages (from slipcover==0.1.2.dev202204290945) (0.8.9)
Installing collected packages: slipcover
Successfully installed slipcover-0.1.2.dev202204290945
(py38) PS C:\Users\vagrant> python -m slipcover
Traceback (most recent call last):
  File "C:\Users\vagrant\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\vagrant\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\vagrant\py38\lib\site-packages\slipcover\__main__.py", line 4, in <module>
    from slipcover import slipcover as sc
  File "C:\Users\vagrant\py38\lib\site-packages\slipcover\slipcover.py", line 8, in <module>
    from . import tracker
ImportError: DLL load failed while importing tracker: The specified module could not be found.

@jaltmayerpizzorno
Copy link
Collaborator

Mm, a few questions:

  • where is your Python from (Microsoft, Conda, ...)?
  • does dir /s python38.dll yield any files?

@exarkun
Copy link
Author

exarkun commented Apr 29, 2022

where is your Python from (Microsoft, Conda, ...)?

It's the Python.org build from https://www.python.org/downloads/release/python-380/ (amd64)

does dir /s python38.dll yield any files?

C:\>dir /s python38.dll
 Volume in drive C is Windows 10
 Volume Serial Number is 2C18-1FAE

 Directory of C:\Users\vagrant\AppData\Local\Programs\Python\Python38

10/14/2019  07:43 PM         4,183,112 python38.dll
               1 File(s)      4,183,112 bytes

     Total Files Listed:
               1 File(s)      4,183,112 bytes
               0 Dir(s)  27,779,457,024 bytes free

C:\>

@jaltmayerpizzorno
Copy link
Collaborator

This works for me, with that very same Python, both with and without a venv. I suspect the issue is a DLL import dependency being created by Visual Studio when it is compiled on GitHub. It works on my system...

@jaltmayerpizzorno
Copy link
Collaborator

@exarkun, please try again with pip install -i https://test.pypi.org/simple/ slipcover==0.1.2.dev202204291210.

@exarkun
Copy link
Author

exarkun commented Apr 29, 2022

Aha. Success -

(py38) PS C:\Users\vagrant> pip install -i https://test.pypi.org/simple/ slipcover==0.1.2.dev202204291210
Looking in indexes: https://test.pypi.org/simple/
Collecting slipcover==0.1.2.dev202204291210
  Downloading https://test-files.pythonhosted.org/packages/c6/e9/e9c1b5e080a7b1945e08ae53e149369b6184858bce74060a173b092e6adb/slipcover-0.1.2.dev202204291210-cp38-cp38-win_amd64.whl (78 kB)
     ---------------------------------------- 79.0/79.0 KB 1.5 MB/s eta 0:00:00
Requirement already satisfied: tabulate in c:\users\vagrant\py38\lib\site-packages (from slipcover==0.1.2.dev202204291210) (0.8.9)
Installing collected packages: slipcover
Successfully installed slipcover-0.1.2.dev202204291210
(py38) PS C:\Users\vagrant> python -m slipcover
usage: slipcover [-h] [--json] [--pretty-print] [--out OUT] [--source SOURCE] [--omit OMIT] [--threshold T] (-m MODULE | script) ...
slipcover: error: one of the arguments -m script is required
(py38) PS C:\Users\vagrant> python -m slipcover -m twisted.trial _zkapauthorizer.tests.test_pricecalculator
_zkapauthorizer
  tests
    test_pricecalculator ...                                            [ERROR]

===============================================================================
[ERROR]
Traceback (most recent call last):
  File "C:\Users\vagrant\py38\lib\site-packages\twisted\trial\runner.py", line 691, in loadByName
    return self.suiteFactory([self.findByName(name, recurse=recurse)])
  File "C:\Users\vagrant\py38\lib\site-packages\twisted\trial\runner.py", line 451, in findByName
    obj = reflect.namedModule(searchName)
  File "C:\Users\vagrant\py38\lib\site-packages\twisted\python\reflect.py", line 156, in namedModule
    topLevel = __import__(name)
  File "C:\Users\vagrant\py38\lib\site-packages\slipcover\__main__.py", line 26, in exec_module
    exec(code, module.__dict__)
  File "c:\users\vagrant\zkapauthorizer\src\_zkapauthorizer\tests\__init__.py", line 69, in <module>
    _configure_hypothesis()
  File "c:\users\vagrant\zkapauthorizer\src\_zkapauthorizer\tests\__init__.py", line 27, in _configure_hypothesis
    from hypothesis import HealthCheck, settings
builtins.ModuleNotFoundError: No module named 'hypothesis'

_zkapauthorizer.tests.test_pricecalculator
-------------------------------------------------------------------------------
Ran 1 tests in 0.047s

FAILED (errors=1)

File                                                    #lines    #missed    Cover%  Lines missing
----------------------------------------------------  --------  ---------  --------  -------------------------------------------------------------------------------------------------------
zkapauthorizer\src\_zkapauthorizer\__init__.py               6          0       100
zkapauthorizer\src\_zkapauthorizer\_version.py              24          9        62  29, 31-36, 39, 41
zkapauthorizer\src\_zkapauthorizer\tests\__init__.py        41         36        12  29-30, 36, 39, 42, 44, 48-49, 52, 54, 60-61, 64-66, 72, 74-76, 78-83, 85-86, 89-91, 95-97, 99, 101, 104

@jaltmayerpizzorno
Copy link
Collaborator

Nice! Thank you for your help.

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