relume Posted March 10, 2020 Share Posted March 10, 2020 VectorWorks : v2020 SP2 MacOSX : 10.14.6 Hello I am facing big troubles to install some modules like "geopandas" to use them with VectorWorks 2020. Actually I can install with an external python installation version 3.5.9 (the latest version in 3.5) all needed modules. Unfortunately there are some incompatibilities (for example for "pandas") while importing against the the internal VectorWorks 2020 python version 3.5.2 and its built-in functions. So I installed a python 3.5.2 version from the official download page, but now it is not possible to locate any external module, that satisfy the requirements of version 3.5.2 and further I am getting errors that says: 1 location(s) to search for versions of rtree: * https://pypi.python.org/simple/rtree/ Getting page https://pypi.python.org/simple/rtree/ Looking up "https://pypi.python.org/simple/rtree/" in the cache Returning cached "301 Moved Permanently" response (ignoring date and etag information) Looking up "https://pypi.org/simple/rtree/" in the cache Cache entry deserialization failed, entry ignored Starting new HTTPS connection (1): pypi.org Could not fetch URL https://pypi.python.org/simple/rtree/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c: It seems that VW 2020 python version 3.5.2 is really outdated and thus it would be "best" to update the internal VW version to 3.5.9 at least. Is this feasible and how? Many thanks, relume Quote Link to comment
JBenghiat Posted March 10, 2020 Share Posted March 10, 2020 The python install Is a resource library within the VW application bundle, and all python commands run with this environment. You can designate paths to external modules, but not to a different environment. This should be a standard install of 3.5.2. In theory, you could update python here, however you could risk breaking the internal vs commands. If you’re using something like pip to install external modules, I would: - Install 3.5.2 in the OS and set as the default py3 environment. - Run your installers and test in python 3. - Point Vectorworks external paths option (Script settings) to the directory where pip installed your modules. Quote Link to comment
relume Posted March 11, 2020 Author Share Posted March 11, 2020 Hello JBenghiat Thank you very much for your message. Yes I had allready carried out the same steps as your hints, prior to post the topic. Finally I could resolve the problem with the 3.5.2 installer that was broken for a outdated SSL certificate (with pip it was not possible any more to get the python "pypi.python.org" cache for looking about python packages. Neither it was possible to update PIP for the same reason. Updating PIP resolved the problem: curl https://bootstrap.pypa.io/get-pip.py | python3.5 where python3.5 is the python version installed from 3.5.2 best regards, relume Quote Link to comment
Vectorworks, Inc Employee Vlado Posted March 11, 2020 Vectorworks, Inc Employee Share Posted March 11, 2020 Hi @relume and @JBenghiat did you manage to get it to work? First note that Vectorworks embeds the python engine, which means that Vectorworks is the python. So, if you just update your local python you are not really affecting vectorworks at all. So as Josh suggested, you can download the 3.5.2 on the side and manually copy it over into the Vectorworks bundle. However, there might be problems with this. There are two sides of python: first it's the engine itself, it is linked, embedded into Vectorworks, and there is no way to change it unless we rebuild Vectorworks on our end. The second part is the python built-in libraries. This is what you would be updating if you just copy them into the Vectorworks bundle. I guess it would work as long as python engine supports the new bundle directly. Of course you can try, just test it out carefully as not to have strange effects on other python based features. Regards, Vlado Quote Link to comment
relume Posted March 11, 2020 Author Share Posted March 11, 2020 Hello Vlado Thank you very much for your response. That clarifies what I was assuming – but hopped it is not the case. But it is the reason why in VW python "sys.excecutable" on the MacOS/darwin plattform is pointing to the VW app, and why "pyhton" and "pip" are not exectuable on the command line inside the darwin VW app package/bundle (error : missing python image). It would makes only sens to install an additional python installation inside the VW app/bundle, if this will replace the internal VW python environment to run the scripts. But after some days finally I was able to install 3.5.2 and get it run as standard installation on the MacOS . This 3.5.2 standard system installation is only used to get the rigth modules (like geopandas and some related modules) installed an be used in VW (installed on '~/Library/Application Support/VectorWorks/2020/Python Externals'). But I have also to say that python 3.5.2 is for lot of modules a critical version. Python 3.5.3 is much less critical - but module versions loaded with 3.5.3, were incompatible with 3.5.2. Thus I would very appreciate, if in VectorWorks a more recent version of python would be embedded - at least the latest version of an allready EOL minor version - for python 3.5 > 3.5.9. But meanwhile python 3.7 is very common, not pointing to python 3.8. Many thanks again and best regards, relume Quote Link to comment
Vectorworks, Inc Employee Vlado Posted March 11, 2020 Vectorworks, Inc Employee Share Posted March 11, 2020 1 hour ago, relume said: But it is the reason why in VW python "sys.excecutable" on the MacOS/darwin plattform is pointing to the VW app, and why "pyhton" and "pip" are not exectuable on the command line inside the darwin VW app package/bundle (error : missing python image). Well, the equivalent of the console command 'python' is a Vectorworks document script. You can execute pip-like stuff that way. Also, note that python is very flexible in the sense of libraries. Perhaps you can try moving only the necessary stuff into the users folder: <user name>/Plugins By default vectorworks will add that location to the search path of the python engine. So if you can isolate necessary needed pieces, you can provide them there. This is, of course, if there is no conflict with the exiting packages in the app bundle. 1 hour ago, relume said: But I have also to say that python 3.5.2 is for lot of modules a critical version. I'll make it a point to update for the next release. 2 Quote Link to comment
relume Posted March 12, 2020 Author Share Posted March 12, 2020 Hello Vlado Many thanks again, I appreciate very much your considerations. Quote Link to comment
ankitlathiya Posted August 27, 2020 Share Posted August 27, 2020 Yes, I agree with it. If you’re using something like pip to install external modules, I would: - Install 3.5.2 in the OS and set as the default py3 environment. - Upgrade pip version. - Run your installers and test in python 3. - Point Vectorworks external paths option (Script settings) to the directory where pip installed your modules. Best regards, Quote Link to comment
JoeBayLD Posted January 13, 2021 Share Posted January 13, 2021 Hi @Vlado, Have you been able to work on upgrading the Python version in 2020? I'm using urllib3 in my plugin, but cannot make HTTPS calls in it because of an outdated TLS version. Specifically the OpenSSL version is very old and not compatible with modern HTTPS. My plugin works great in 2021 as it has Python 3.8, but I'm stuck with a TLSV1_ALERT_PROTOCOL_VERSION when using 2020. Do you think it will ever get updated or am I stuck with not providing support for my plugin in 2020? Thanks, Joe Quote Link to comment
Vectorworks, Inc Employee Vlado Posted January 13, 2021 Vectorworks, Inc Employee Share Posted January 13, 2021 Hi @JoeBayLD, Unfortunately, Vectorworks 2020 python cannot be updated as it is a major change with lot of risk. 16 hours ago, JoeBayLD said: I'm stuck with a TLSV1_ALERT_PROTOCOL_VERSION when using 2020 is this a SSL:CERTIFICATE_VERIFY_FAILED ? if so, then there is a way to create shortcuts in the python of vectorworks to add access to certificates. Quote Link to comment
JoeBayLD Posted January 13, 2021 Share Posted January 13, 2021 That’s unfortunate. It’s not a SSL issue I don’t think. I did have some SSL issues in 2021, but I end up disabling SSL for the request and that solves it. This is a TLSv1 issue and has something to do with OpenSSL 0.9.8zh (which is no longer supported). The only way I’ve read on how to update that is with a newer version of python. Is there a way to use the systems python version to execute the request? The latest macOS ships with 3.8 so I could use that if there’s a way to access it. Also, what are the shortcuts you’re talking about? Quote Link to comment
Vectorworks, Inc Employee Vlado Posted January 13, 2021 Vectorworks, Inc Employee Share Posted January 13, 2021 10 minutes ago, JoeBayLD said: Is there a way to use the systems python version to execute the request? The latest macOS ships with 3.8 so I could use that if there’s a way to access it. I'm not sure exactly, but you should be able to send 'system' commands, and run scripts using the system. 10 minutes ago, JoeBayLD said: Also, what are the shortcuts you’re talking about? I'm still not fully researched this, but it was related to the SSL:CERTIFICATE_VERIFY_FAILED error. Essentially, you need to install a symlink to the system's certificates into the SLL of the Python you are using (Vectorworks') I don't know exactly yet, but I have this URL saved for further investigation: https://stackoverflow.com/questions/35569042/ssl-certificate-verify-failed-with-python3 and this code snippet: import os import certifi import ssl openssl_dir, openssl_cafile = os.path.split(ssl.get_default_verify_paths().openssl_cafile) os.chdir(openssl_dir) relpath_to_certifi_cafile = os.path.relpath(certifi.where()) print("delete: "+openssl_cafile) print("sym link") print(" src="+relpath_to_certifi_cafile) print(" dst="+openssl_cafile) and this code for testing, where it was failing due to the error mentioned above: import urllib.request requestURL = urllib.request.Request( "https://www.vectorworks.net/cached/themes/vectorworks_redesign_2018/assets/images/logos/vw-logo-full.svg", headers={'User-Agent' : "Magic Browser"} ) response = urllib.request.urlopen( requestURL ) Quote Link to comment
Recommended Posts
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.