Jump to content

K.Lalkovski

Vectorworks, Inc Employee
  • Posts

    111
  • Joined

  • Last visited

Posts posted by K.Lalkovski

  1. 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.
     

  2. Hi @Paolo,

    There are two approaches to resolve the problem:

    First approach: Replace VW2022 SP1(619242) with the new VW 2022 SP2(622317) .

    Second, if you prefer to deal with the existing VW2022 SP1(619242)

    Please, find the attached file scripts.zip.

    On the problematic PC:
    1. Go to <VW App folder>\Python39\Scripts

    2.Delete the contents of this folder.

    3.Unzip the contents of the scripts.zip file

    4.Run VW and try to install PIL.

    You should be able to install the Pillow package and any other package.

    Let me know if this works for you!

    Scripts.zip

    • Like 2
  3. 13 hours ago, Paolo said:

    Hello @K.Lalkovski,

    here we are again… still the

    Marionette.VerifyOrGetLib()

    does not work on Windows, Vectorworks 2022, importing Pillow module.

    Here below the code I am using, with the appropriate wheel files. It works on macs (arm or x86), but does not install nothing on Windows.

    Previously, with Vectorworks 2021, it worked…

    Can you address me (us) to a fix, even creating a temporary alternative function to the VerifyOrGetLib()?

     

    Also I am still getting the same warning (see post dated january 5 in this same thread) after the (correct) module installation on mac.

     

    import platform
    import Marionette 
    arm64 = ('arm64' in platform.machine())
    (major, minor, maintenance, platform, buildNum) = vs.GetVersionEx()
    #vectorworks 2022 has python 3.9.2
    if platform == 2:
        PIL = 'https://files.pythonhosted.org/packages/20/ec/15a263f2c65d71cf62aa767f774c2381077e07beb1e9309a94461ec1cd29/Pillow-8.4.0-cp39-cp39-win_amd64.whl'
        
    else:
        PIL = 'https://files.pythonhosted.org/packages/32/25/32889d2b7c577b5a454dd12194b2ecb9d87d4b49c15c278dc99bc8ff5d2e/Pillow-8.4.0-cp39-cp39-macosx_10_10_x86_64.whl'
        
        #for mac M1
        if arm64:
            PIL = 'https://files.pythonhosted.org/packages/7d/88/a59b397f030e131accd4ca5a2ad7f1ac62347e6f4aadbe3dabd329aaded9/Pillow-8.4.0-cp39-cp39-macosx_11_0_arm64.whl'
    result = Marionette.VerifyOrGetLib('PIL', PIL)
    if result:
        vs.AlrtDialog('PIL module is correctly installed:\n', PIL)
    else: #PIL not installed
        vs.AlertCritical('Attention!','It has been not possible to install the PIL module.')

    cc: @tbexon, @DomC

     

    Hi @Paolo,

    Let me check and I'll get back to you later today.

    • Like 1
  4. On 10/31/2021 at 10:35 AM, tbexon said:

     

     

    On 10/31/2021 at 10:35 AM, tbexon said:

    Hello All

     

    Some potential 2022 funkyness. I use the EvalStr function to get the localized string for "True" to then use this to compare to the results from Checkboxes using GetRField. (For more information on the method/reasoning see the below thread where @JBenghiatvery kindly showed me this method in the first place)  

     

    Since migrating my plug ins to VW2022 I have noticed that EvalStr is now returning a boolean not a string, and thus causing all my comparisons to fail. 

    localized_True_Bool = vs.EvalStr(vs.Handle(0), "1=1")  # Gets Localised True Bool
    vs.AlrtDialog(str(type(localized_True_Bool)))

    I have tried the above test script in both 2021 and 2022. in 2021 it returns the Expected results of the String "True", however in 2022 it returns a Boolean of True.

     

    My questions are:

    A) Can anyone else replicate this and get the same results?

    B) Is this working as intended, or a bug?  I can't see anything on the Function Reference suggesting that this has been changed in 2022, however maybe @Vlado or @K.Lalkovskimight be able to shed some light?

     

    Thanks in advance!

     

  5.  

    38 minutes ago, Paolo said:

    Hello @K.Lalkovski ,

    I am still getting the same warning trying to install Pillow module (you said should have been fixed…).

    The module is correctly installed, but this warning is presented as a script error and users of my PlumBob plugin gets disoriented.

    I am running Vectorworks 2021 R1 (Build 563191) on MacOS 10.14.6.879439704_Schermata2021-01-05alle08_42_43.thumb.png.76aeb84ba379044daa1e09b79600d433.png

    Hello @Paolo

    I have been working on this issue when I have a good result  I'll let you know.

  6. @Paolo  It is a warning, not an error. The pip module is part of the current  python distribution with Vectorworks, both on PC and Mac. The distribution is embedded into the Vectorworks application bundle on Mac. On Win it is just a folder on the disk. On Mac, the pip module cannot be directly accessed as this can be done on PC. This line of code is used to access the embedded pip on Mac   ret_code = pip.main(['install', destination,'-q','--target', cmd])  and it is the reason for the warning. In the next version of VerifyOrGetLib,  I'll  fix the line in order to remove that warning.

    • Like 2
  7. @tbexon Could please try this pip3.exe in the attached archive pip3.zip

    1.Goto VW folder\Python35\Scripts

    2.rename old pip3.exe to pip3old.exe

    3.unzip new pip3.exe.

    4.Start VW and try on your machine the script above that was giving the error "SyntaxError: Non-UTF-8 code starting with '\x90'" in file D:\Program Files\Vectorwork". Report the results here.If there is no more such a syntax error try to download PIL for Python 3.5 via Marioentte.VerifyOrgetLib and let me kknow about the result.

    pip3.zip

    • Like 1
  8. @Paolo If possible let the user  execute the following script from the command line. Goes to Python folder of VW(Python35).
    import sys
    import locale
    print("sys.stdin.encoding = ", sys.stdin.encoding)
    print("locale.getpreferredencoding = ",locale.getpreferredencoding())
    print("locale.getpreferredencoding = ",locale.getpreferredencoding(False))
    print("sys.getdefaultencoding = ",sys.getdefaultencoding())
    print("sys.getfilesystemencoding = ",sys.getfilesystemencoding())

  9. @Paolo ,

    Could you please report the exact number of the build 2020 sp4 you are using? 

    Could I have also any available information about windows (version, build), where the problem with pip 3 occurs.

    Do you have any other python installation on your PC ? 

    I have tested your file Download PIL.vwx with 2020 SP4(551884), everything seems OK.

    I have Windows 10 Pro, build 1903.

    Please, take a look at the attached video.

    18 hours ago, tbexon said:

    cmdpip, 'pip list'

     

     

    • Like 1
×
×
  • Create New...