Jump to content

2021 Import Errors for External Python Packages


Recommended Posts

So I just moved all my plugins across to VW 2021, and I'm now getting Import Errors for Plug ins that use the External Package PyOpenSSL.

 

The error i'm getting is: 

DLL load failed while importing _openssl: The specified module could not be found.

I've tried both deleting and reinstalling PyOpenSSL via VerifyOrGetLib, aswell as simply copying the working "Python Externals" from 2020 Plug in folder, neither seems to solve the issue.

 

Pip does seem to be successfully installing PyOpenSSL, with the most up to date versions of it's dependents. 

 

I'm aware that with 2021 the Python distribution has been upgraded to 3.8, so I'm wondering if something to do with that could be causing this? Checking the docs here  it is compatible with 3.5+

 

I don't believe it's an issue with the package itself as if I install it, and run from my local copy of Python 3.8 via IDLE it imports fine. 

 

Any thoughts would be greatly appreciated! This is rather where my knowledge reaches it's limit!

Link to comment
  • 3 weeks later...

Hi
Same issue here. I think the installation of Python Moduls via VerifyOrGetLib still works. I had not much time to go deeper into that problem. Spontaneously I would say, Vectorworks 2021 uses "Python Externals" as the installation Path and "PythonExternals" as the search Path or "Python Externals" do not work anymore for the Script Engine. Also it is confusing, I cant set the Folder "Python Externals" as a search Path of a Python Script. 

image.thumb.png.07fa04c35337c41c6c8678c404b59dff.png

 

As a short fix I was able to Install all Moduls with the Marionette nodes. After That renaming "Python Externals" to "PythonExternals" and it worked. Tried this on Mac, Installed new Pillow Fork with the Node. Then Renamed the Python Externals Folder and all my old "Pillow" Examples worked here.

Beside that here I have an issue, that Marionette Scripts do not "Alert" Errors. I had to thest with Text-Scripts.

Hope that Workaround is able to fix it also for your Scripts.

Regards

 

 

import numpy scipy pillow etc v2021.vwx

Link to comment

Just tried on Mac (10.14.6 Mojave)
Did again some test with a blank user folder and  Build 571107. I did the following:

1. Installed PIL with the attached Marionette Node
2. Tested to import PIL by Script or Marionette Node > Failed Module not found
3. Tried to set search-Path to "Python Externals" > Failed
4. Tried running Marionette Node with this Module > Failed
5. Renamed folder to "PythonExternals"
6. Setting search Path to that Folder in a Script > OK
7. Tested import of the Module in Script > OK

8. Running Marionette Example with PIL > OK

9. Renamed back "PythonExternals" to "Python Externals" run again Marionette Example > OK

(now I am confused, maybe a caching thing)

Movie attached
  Edited by DomC
Link to comment

Hello
I looked into the Scripts from Marissa and Sarah and their .whl Installers are Working. So I think it is just an issue of the correct Library Installer. The .whl Installer I used, creates an error because of PIP incompatibility. And then I think the issue is, that not immediately the library can be imported.

I will try Update this Stand-Allon-Installation-Nodes  ca. middle next week. 

 

Link to comment
On 10/27/2020 at 3:15 PM, K.Lalkovski said:

@tbexon 
Where do you receive this behavior om Mac OS or Windows?

I'm running Windows

 

@domC Following you're suggested process, I got the same results. Strangely when I look at the environment paths within the VW Python environment, using sys.path(), "Python Externals" is in there. 

 

I'm still having issues with my specific package (pyOpenSSL) 

 

DLL load failed while importing _openssl: The specified module could not be found.

If I try running with a clean 3.8 interpreter outside of VW it runs fine, same as within 2020.

Link to comment
  • 1 month later...

Hi all,

Numpy_2021.pdf

I'm trying to install numpy in Vectorworks 2021 with no success - I've updated the install nodes from @DomC with the 3.8 version of numpy (see attached), and tried renaming External Packages to ExternalPackages. Don't quite understand the bit about PIP incompatibility - any help appreciated!

 

Thanks,

 

Naomi

Link to comment
  • 1 year later...

I tried running DomC's node "Install numpy" on it's own and got an error "module numpy cannot be downloaded". Running VW 2020 SP6 on PC

 

I checked the file path from https://pypi.org/project/numpy/1.17.4/#files

and copied link to check and it matched the node entry below:

 

numpy = 'https://files.pythonhosted.org/packages/25/71/37628d7654da4a539f33497c9d9d6713d2bb3c9e35638776b3eea38ca04a/numpy-1.17.4-cp35-cp35m-win_amd64.whl'

 

I even tried pasting into a browser which allowed me to download ".whl" file.  I tried alternative pre path "https://pypi.python.org/packages" - same error

 

I even tried (as VW2020 uses Python 3.5)

https://files.pythonhosted.org/packages/ed/09/ff8f529a5548ff788765f66a81ef751130f26f8c7d517e94d3dbf3ba1ed5/numpy-1.18.5-cp35-cp35m-win_amd64.whl

 

I'm kind of stuck

Link to comment

Just to say I successfully loaded numpy "1.18.5 cp35" in VW2021 via DomC's node and copied the folder "Python Externals" back to folder ...Appdata/Roaming/Nemetschek/Vectorworks/2020

 

I also successfully ran script below

 

import numpy as np
a = np.asarray((1,0,0,0,1,0,0,0,1))
vs.AlrtDialog(str(a))

 

I can now learn/try out some open source python code for Euler/Quaterion rotations.

  • Like 1
Link to comment
  • 2 weeks later...

ive found the built in ways to be very inconsistant... currently anytime i need to add a external python library i do a normal pip3 install and go find where it installed it which normally for me is in "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages".

 

i then copy and paste the installed libraries into a "Python Externals" folder in the user folder and its worked every time so far. i think i have 5-6 libraries in there.

Link to comment
  • 6 months later...
  • Vectorworks, Inc Employee
On 10/7/2020 at 6:26 PM, tbexon said:

So I just moved all my plugins across to VW 2021, and I'm now getting Import Errors for Plug ins that use the External Package PyOpenSSL.

 

The error i'm getting is: 

DLL load failed while importing _openssl: The specified module could not be found.

I've tried both deleting and reinstalling PyOpenSSL via VerifyOrGetLib, aswell as simply copying the working "Python Externals" from 2020 Plug in folder, neither seems to solve the issue.

 

Pip does seem to be successfully installing PyOpenSSL, with the most up to date versions of it's dependents. 

 

I'm aware that with 2021 the Python distribution has been upgraded to 3.8, so I'm wondering if something to do with that could be causing this? Checking the docs here  it is compatible with 3.5+

 

I don't believe it's an issue with the package itself as if I install it, and run from my local copy of Python 3.8 via IDLE it imports fine. 

 

Any thoughts would be greatly appreciated! This is rather where my knowledge reaches it's limit!

Hi TBexon,

 I do not know if you have found the solution for your issue or still interested in running PyOpenSSL with Vectorworks,
 but on Friday I started looking at this problem while resolving a bug from Dominique about the serch path.
 The DLL that pyOpenSSL looks for is python3.dll.It is in python's folder where also python.exe resides. 
 This path is included in the python search paths in VW. 
 For some reason the code of pyOpenSSL when installed cannot find python3.dll.It's package's code search problem. 
 If you copy python3.dll from python's folder to VW application folder(where VW exe resides) you will be able to use pyOpenSSl.
 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...