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

Windows support #20

Open
jmkerloch opened this issue Feb 15, 2022 · 1 comment
Open

Windows support #20

jmkerloch opened this issue Feb 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@jmkerloch
Copy link

Expected behaviour
I would like to use pytest-qgis in Windows environnement

Current behaviour
I tried to launch a test with pytest-qgis use but the module can't be initialized

File "C:\Users\jmker\AppData\Local\Programs\Python\Python39\lib\site-packages\_pytest\assertion\rewrite.py", line 171, in exec_module
    exec(co, module.__dict__)
  File "C:\Users\jmker\AppData\Local\Programs\Python\Python39\lib\site-packages\pytest_qgis\__init__.py", line 21, in <module>
    from pytest_qgis.pytest_qgis import *  # noqa
  File "C:\Users\jmker\AppData\Local\Programs\Python\Python39\lib\site-packages\_pytest\assertion\rewrite.py", line 171, in exec_module
    exec(co, module.__dict__)
  File "C:\Users\jmker\AppData\Local\Programs\Python\Python39\lib\site-packages\pytest_qgis\pytest_qgis.py", line 34, in <module>
    from qgis.core import Qgis, QgsApplication, QgsProject, QgsRectangle, QgsVectorLayer
  File "C:\PROGRA~1\QGIS32~1.1\apps\qgis\python\qgis\core\__init__.py", line 25, in <module>
    from qgis._core import *
ImportError: DLL load failed while importing _core: La procédure spécifiée est introuvable.

My PYTHONPATH and PATH are defined for Qgis use

echo %PYTHONPATH%
C:\PROGRA~1\QGIS32~1.1\apps\qgis\python

echo %PATH%
C:\PROGRA~1\QGIS32~1.1\bin;C:\PROGRA~1\QGIS32~1.1\apps\qgis\bin;C:\Users\jmker\AppData\Local\Programs\Python\Python39;C:\Program Files\Microsoft MPI\Bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\CMake\bin;C:\Users\jmker\AppData\Local\Programs\Microsoft VS Code\bin;

Describe alternatives you've considered
I did try a manual import in a python console and I managed to import Qgis modules

python
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from qgis.core import Qgis, QgsApplication, QgsProject, QgsRectangle, QgsVectorLayer
>>>

Additional context
Os : Windows 10
pytest-qgis : 1.3.0

@jmkerloch jmkerloch added the enhancement New feature or request label Feb 15, 2022
@Joonalai
Copy link
Contributor

Joonalai commented Mar 4, 2022

Thank you for the issue! We haven't been able to reproduce this issue on Windows yet, but we are trying to get this reproduced at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants