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

Importing cadquery in python 3.8 on Windows fails #692

Closed
fedorkotov opened this issue Mar 16, 2021 · 7 comments
Closed

Importing cadquery in python 3.8 on Windows fails #692

fedorkotov opened this issue Mar 16, 2021 · 7 comments

Comments

@fedorkotov
Copy link
Contributor

fedorkotov commented Mar 16, 2021

Cadquery for windows is broken since yesterday for some reason. I first experienced it when Windows CI pipelines for #688 failed. But yesterday I did not have access to Windows machine.

Today on windows machine I got rid of full anaconda I was using before and installed miniconda instead https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe

The OS is Windows 8.1

This is how I created conda environment

conda create -n cadquery -c cadquery -c conda-forge cq-editor=master cadquery=master

And this is pyhton version And my attempt to import cadquery. Sorry for Russian error message. It means The specified module could not be found (the same as in azure pipelines).

(cadquery) d:\Fedor\tools\miniconda>python
Python 3.8.8 | packaged by conda-forge | (default, Feb 20 2021, 15:50:08) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cadquery as cq
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\KotovF\miniconda3\envs\cadquery\lib\site-packages\cadquery\__init__.py", line 2, in <module>
    from .occ_impl.geom import Plane, BoundBox, Vector, Matrix, Location
  File "C:\Users\KotovF\miniconda3\envs\cadquery\lib\site-packages\cadquery\occ_impl\geom.py", line 5, in <module>
    from OCP.gp import gp_Vec, gp_Ax1, gp_Ax3, gp_Pnt, gp_Dir, gp_Trsf, gp_GTrsf, gp, gp_XYZ
ImportError: DLL load failed while importing OCP: Не найден указанный модуль.
@fedorkotov
Copy link
Contributor Author

This is output of conda list

conda_list.txt

@fedorkotov
Copy link
Contributor Author

fedorkotov commented Mar 16, 2021

I checked with Process Monitor utility from sysinternals and discovered that python.exe searches for FreeImage.dll in all folders in path and can't find it when I run import cadquery as cq. When I placed the dll downloaded from here http://downloads.sourceforge.net/freeimage/FreeImage3180Win32Win64.zip (x64 version) into miniconda3\envs\cadquery\ cadquery successfully imported.

pytest on my fork of cadquery also executed without errors.

Does cadquery depend on freeimage directly but fails to install it? Or is this a bug in some other dependency down the line?

@jmwright
Copy link
Member

@adam-urbanczyk Has filed a freeimage bug report. The fix for now is to force an older version: conda install -c conda-forge freeimage=3.18.0=h33f27b4=0

@fedorkotov
Copy link
Contributor Author

Seems to be resolved. Windows CI pipelines for #688 have completed successfully.
When I created a new conda environment locally on windows machine everything also worked without adding freeimage dll manually

@wolfv
Copy link

wolfv commented Mar 19, 2021

Hi @fedorkotov would you mind re-running the CI tests to check if the latest free image builds for windows are fine?

@adam-urbanczyk would be cool if you can close the issue in the freeimage-feedstock if that's the case. Thanks!

@fedorkotov
Copy link
Contributor Author

fedorkotov commented Mar 19, 2021

@wolfv windows CI pipelines have just completed without errors in #694 with freeimage 3.18.0-hb49e22e_7

@wolfv
Copy link

wolfv commented Mar 19, 2021

Awesome, thanks

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

No branches or pull requests

3 participants