Non programmer stuck: No module named dxfwrite

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
CraigCu
Posts: 15
Joined: Thu Jan 07, 2016 9:53 pm
Location: McFarland WI

Non programmer stuck: No module named dxfwrite

Post by CraigCu »

I researched this but I am confused by the answers and discussions. I am not a programmer.

I am following Yorik's "A Manual" and following exactly the instructions for the IKEA chair and the last step is DXF output but I get "No module named dxfwrite".

So can someone tell me, like I am 5 years old, what exactly do I do?
Craig, AMTELCO
User avatar
CraigCu
Posts: 15
Joined: Thu Jan 07, 2016 9:53 pm
Location: McFarland WI

Re: Non programmer stuck: No module named dxfwrite

Post by CraigCu »

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6712 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: da2d364457257a7a8c6fb2137cea12c45becd71a
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Craig, AMTELCO
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Non programmer stuck: No module named dxfwrite

Post by yorik »

You need to install a separate component: https://www.freecadweb.org/wiki/Dxf_Importer_Install
User avatar
CraigCu
Posts: 15
Joined: Thu Jan 07, 2016 9:53 pm
Location: McFarland WI

Re: Non programmer stuck: No module named dxfwrite

Post by CraigCu »

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6712 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: da2d364457257a7a8c6fb2137cea12c45becd71a
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
yorik wrote: Tue Mar 20, 2018 1:16 pm You need to install a separate component: https://www.freecadweb.org/wiki/Dxf_Importer_Install
Thank you, Yorik, for responding, but that did not help.
I followed the directions and replaced what was already there (1.39) for FreeCAD v0.16.6712.

I am following your Manual regarding "Generating 2D drawings" (IKEA chair) and on page 109:
"Our page can now be exported . . .<SNIP>
The Drawing Dimensioning
workbench also features its own DXF export tool
, which also . . .<SNIP>."
Craig, AMTELCO
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Non programmer stuck: No module named dxfwrite

Post by wandererfan »

Are you pushing this button:
32px-DrawingDimensioning_ExportToDxf.png
32px-DrawingDimensioning_ExportToDxf.png (1.76 KiB) Viewed 1999 times
?

If so, then you're using DrawingDimensioning Workbench which I believe uses this dxf library: https://pypi.python.org/pypi/dxfwrite/1.2.0.

Install it somewhere in your Python path and you should be good to go.
User avatar
CraigCu
Posts: 15
Joined: Thu Jan 07, 2016 9:53 pm
Location: McFarland WI

Re: Non programmer stuck: No module named dxfwrite

Post by CraigCu »

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6712 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: da2d364457257a7a8c6fb2137cea12c45becd71a
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
wandererfan wrote: Wed Mar 21, 2018 12:37 am Are you pushing this button: 32px-DrawingDimensioning_ExportToDxf.png?
Yes, exactly.
wandererfan wrote: Wed Mar 21, 2018 12:37 am If so, then you're using DrawingDimensioning Workbench
Yes, exactly.
wandererfan wrote: Wed Mar 21, 2018 12:37 am which I believe uses this dxf library: https://pypi.python.org/pypi/dxfwrite/1.2.0.
Install it somewhere in your Python path and you should be good to go.
Ah, this was not mentioned in Yorik's manual. I have downloaded dxfwrite-1.2.0 now but do not understand installation instructions.
I am not a programmer. Is it as simple as copying the extracted dxfwrite-1.2.0 folder to:
C:\Users\ccullum\AppData\Roaming\FreeCAD ?
Craig, AMTELCO
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Non programmer stuck: No module named dxfwrite

Post by wandererfan »

CraigCu wrote: Wed Mar 21, 2018 2:44 pm I am not a programmer. Is it as simple as copying the extracted dxfwrite-1.2.0 folder to:
C:\Users\ccullum\AppData\Roaming\FreeCAD ?
Boy, you're really getting the bottom of the support barrel on this one - I don't use Windows, I don't use Drawing Dimensioning and I'm not a Python whiz. Never the less.....

I don't know the Windows directories, but you should have a "Mod" directory that contains a DrawingDimensioning subdirectory. I would put the unzipped dxfwrite-1.2.0 right beside DrawingDimensioning, something like this:
...Mod
......DrawingDimensioning
......dxfwrite-1.2.0

I just tried this (but on Linux) and it seems to work - at least I get a dxf file that LibreCad can open.
User avatar
CraigCu
Posts: 15
Joined: Thu Jan 07, 2016 9:53 pm
Location: McFarland WI

Re: Non programmer stuck: No module named dxfwrite

Post by CraigCu »

wandererfan wrote: Wed Mar 21, 2018 8:02 pm
CraigCu wrote: Wed Mar 21, 2018 2:44 pm I am not a programmer. Is it as simple as copying the extracted dxfwrite-1.2.0 folder to:
C:\Users\ccullum\AppData\Roaming\FreeCAD ?
Boy, you're really getting the bottom of the support barrel on this one - I don't use Windows, I don't use Drawing Dimensioning and I'm not a Python whiz. Never the less.....
I don't know the Windows directories, but you should have a "Mod" directory that contains a DrawingDimensioning subdirectory. I would put the unzipped dxfwrite-1.2.0 right beside DrawingDimensioning, something like this:
...Mod
......DrawingDimensioning
......dxfwrite-1.2.0

I just tried this (but on Linux) and it seems to work - at least I get a dxf file that LibreCad can open.
Thank you for you patience, wandererfan. Moving files I can deal with. I was just stumped when I saw a reference to doing a pip to install this.
OMG I have not seen that term since my CP/M days.
Craig, AMTELCO
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Non programmer stuck: No module named dxfwrite

Post by yorik »

wow, I hadn't figured that DrawingDimensioning was using dxfwrite, sorry I indeed gave wrong instructions.

Basically you need to be able to do "import dxfwrite" in the freecad python console. For this, the dxfwrite folder (it must be named exactly like this, remove any number version, and check that it contains an __init__.py file), must be in one of the folders of your python search path. You get them like this in the freecad python console:

Code: Select all

import sys
for path in sys.path:
    print path
Place your dxfwrite folder in one of them.

Then check that it works with

Code: Select all

import dxfwrite
If no error appears, everything is OK.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Non programmer stuck: No module named dxfwrite

Post by wandererfan »

CraigCu wrote: Wed Mar 21, 2018 9:14 pm I was just stumped when I saw a reference to doing a pip to install this.
OMG I have not seen that term since my CP/M days.
Acronym Recycling Program in action! Pip is now a Python package manager/installer.
Post Reply