jimy-byerley / pymadcad

Simple yet powerful CAD (Computer Aided Design) library, written with Python.
https://madcad.netlify.app/
GNU Lesser General Public License v3.0
205 stars 15 forks source link

Cannot del version from mathutils, and AttributeError: module 'glm' has no attribute 'u8vec2' #75

Closed ejlmljt closed 1 year ago

ejlmljt commented 1 year ago

pymadcad 0.15.1, Python 3.9.7 , Windows 10, install "pip install pymadcad "Feb 19,2023 Ran from windows cmd window "python madcad_test1.py"

I had to change mathutils.py when script errored out with unfound module Change from

del version, license

to

try: del version, license
except: print ("Could not delete module version,license in mathutils")

Also AttributeError: module 'glm' has no attribute 'u8vec2'

Traceback (most recent call last): File "C:\Users\XXXX\OneDrive\Documents\madcad\madcad_test1.py", line 3, in from madcad import * File "C:\Users\XXXX\AppData\Local\Programs\Python\Python39\lib\site-packages\madcad__init__.py", line 135, in from . import ( File "C:\Users\XXXX\AppData\Local\Programs\Python\Python39\lib\site-packages\madcad\mathutils.py", line 21, in import arrex.glm File "C:\Users\XXXX\AppData\Local\Programs\Python\Python39\lib\site-packages\arrex\glm.py", line 28, in type = getattr(glm, prec+'vec'+str(size)) AttributeError: module 'glm' has no attribute 'u8vec2'

Thanks

jimy-byerley commented 1 year ago

Weird issue, module glm usually has a class u8vec2 Can you please try to run the following in a python shell ?

import glm
print(glm)
print(glm.version)
ejlmljt commented 1 year ago

Thanks for the reply Jim,

I uninstalled the python glm package that was installed with "pip uninstall glm" and pymadcad now works!! Error was caused by conflicting glm modules

It just took seeing the word 'weird' in your reply to think it was something unique to my computer.

Here is my quick check on the installation as it was when pymadcad was giving the error.

import glm print (glm.version())

v0.4.4

import os.path print(os.path.abspath(glm.file))

C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\glm__init__.py

I looked up glm in pypi.org and the package is a fast GridLAB-D to JSON (and back) parser. I don't see the connection from my cursory look at pymadcad. So I deleted glm with

pip uninstall glm

Futher info on the glm package that was installed. glm 0.4.4 https://pypi.org/project/glm/ glm PyPI Python version compatibility status Build Status A fast GridLAB-D to JSON (and back) parser.

Fast GLM to JSON converter. Supports nested objects, schedules, definitions, directives, modules, includes and clock objects Fast JSON to GLM converter. Native support for Python, returns nested dictionaries

On Fri, Apr 21, 2023 at 2:53 PM jimy byerley @.***> wrote:

Weird issue, module glm usually has a class u8vec2 Can you please try to run the following in a python shell ?

import glmprint(glm)print(glm.version)

— Reply to this email directly, view it on GitHub https://github.com/jimy-byerley/pymadcad/issues/75#issuecomment-1518324675, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRJ52BRRXPSAEDM2CKSNKLXCLXUXANCNFSM6AAAAAAXESQ654 . You are receiving this because you authored the thread.Message ID: @.***>

jimy-byerley commented 1 year ago

That's right, the correct glm module for pymadcad is pyglm and not glm from here They are named likewise once installed, but usually that's not a problem when leaving the dependencies resolution to pip ... still this should be harmonized.

Well I'm glad you solved your issue. Come back if you have any other issue ;)

ejlmljt commented 1 year ago

Thanks a lot.

On Mon, Apr 24, 2023 at 11:12 AM jimy byerley @.***> wrote:

Closed #75 https://github.com/jimy-byerley/pymadcad/issues/75 as completed.

— Reply to this email directly, view it on GitHub https://github.com/jimy-byerley/pymadcad/issues/75#event-9083967169, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRJ52AVWZGMSCZE3GI4E2LXC2X6JANCNFSM6AAAAAAXESQ654 . You are receiving this because you authored the thread.Message ID: @.***>