Installing pyodbc problem

Installing pyodbc problem

Anonymous
Not applicable
3,200 Views
4 Replies
Message 1 of 5

Installing pyodbc problem

Anonymous
Not applicable

Hi All,

 

I'm tryng to import pyodbc or pypyodbc in a fusion360 script but it will not work.

As the name of the import suggests it is standard odbc connection plug-in within python.

 

The script hangs on 'import pyodbc'

 

python and pip are installed and working

used 'pip install pyodbc' to install --> ok

ran 'pip freeze' to confirm that pyodbc and pypyodbc are installed.

pyodbc==4.0.24

pypyodbc==1.3.4

 

Roel

 

 

 

 

 

 

0 Likes
Accepted solutions (1)
3,201 Views
4 Replies
Replies (4)
Message 2 of 5

goyals
Autodesk
Autodesk
Accepted solution

Hi,

 

Fusion comes with its own default python package so please check where pyodbc module is installed on your machine. You can use sys.path method to find it out from where Fusion is referring python package. One solution is you can copy 

pyodbc module directly at one of the path which is included in sys.path variable of Fusion python package but that is not an extensible solution. Second possibility is you can keep the modules you want to install at the location where you script is lying. I hope its path then will be automatically consider by Fusion.

 

Regards,

Shyam Goyal

 



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 3 of 5

Anonymous
Not applicable

Hello Shyam,

 

Thank you for your answer. It helped in finding my way in dark...

 

It partially helped to place the pyodbc.py into my application directory. I can now access our MSSQL server.

 

But i'm very confused how python is setup in Fusion360. I do have another python installation on my computer and the moment i start using pip install .... i don't have a clue where this install ends up. I played around with the sys.path and added a modules directory but without any effect.

 

Is there some documentation available how this all works in conjunction with other python setups. Fusion360 is not alone is the world. Best solution would be to bypass the fusion-python and just use my normal python,

 

Tia

Roel

 

0 Likes
Message 4 of 5

goyals
Autodesk
Autodesk

We have integrated python in to Fusion so that script written in python can be executed by Fusion so we can not by-pass the fusion python. We usually try to upto date with our default python packages and right now we are using python 3.5.3. If you are using pip to install any module, it would be added to the package directory where default python is installed on your machine. Fusion is not aware of that path so any module added there can not be accessed by Fusion. We are just providing default python packages.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 5 of 5

Anonymous
Not applicable

Hello Shyam,

 

Thank you for the quick and clear answer. My developer-python(3.7) and fusion-python(3.5.4) are separate installs.

 

But it will not help me installing packages the right way in fusion-python. The default-packages are apparently not enough (pyodbc). Can you redirect me to documentation how to install packages in fusion-python? Or give some instructions how to do this.

 

Tia

Roel