View Issue Details

IDProjectCategoryView StatusLast Update
0004397FreeCADBugpublic2020-07-07 21:38
ReporterFizik Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
OSWindows 10OS VersionBuild 19041.329 
Product Version0.18 
Summary0004397: Extensions module directory lacking from module paths on startup
DescriptionModules installed (by the Extension Manager) in the user Python modules directory %appdata%\FreeCAD\Mod are not accessible by means of the Python console (nor are they available to macros loaded into the workbench) when FreeCAD is started without command line options (e.g. from the start menu after a fresh install).

Things work fine when starting with the --module-path option, like

> path\to\FreeCAD.exe -M %appdata%\FreeCAD\Mod
Steps To ReproduceThis description is pretty arbitrary, but it is what I stumbled across.

  1. Get a fresh install of FreeCAD 0.18.4 on Windows 10.
  2. Install, by means of the Extension Manager, A2+. This drops a Python module directory A2plus in your %appdata%\FreeCAD\Mod directory.
  3. Start FreeCAD (from the Windows Menu, i.e. without command line options).
  4. In the Python console, type
  5.    
    
       >>> import A2plus
       

       The interpreter reports ModuleNotFoundError on A2plus for the line entered.
  6. Quit FreeCAD, and restart with the extension modules directory passed as an additional Python module path, e.g.
  7. 
    > & "$env:ProgramFiles\FreeCAD 0.18\bin\FreeCAD.exe" -M "$env:AppData\FreeCAD\Mod"
    
  8. In FreeCAD, try accessing A2+ from the Python Console again,
  9. 
    >>> import A2plus
    
    The module is now accessible (and can be listed, e.g. dir(A2plus)).
TagsNo tags attached.
FreeCAD InformationOS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

Activities

Fizik

2020-07-02 15:13

reporter   ~0014612

Please delete this. I learned what I did wrong.

openBrain

2020-07-07 16:22

developer   ~0014625

@Fizik : please tell us what you did wrong so everybody will take advantage of this. I'll close ticket when done. Thx.

Fizik

2020-07-07 21:37

reporter   ~0014633

Last edited: 2020-07-07 21:38

View 2 revisions

@openBrain The module is accessible by the name FreeCAD.A2plus (instead of A2plus without the prefix), and hence is imported by

import FreeCAD.A2plus

(I got myself fooled by the — apparently outdated — example file [A2p_animation-example-script.py](https://forum.freecadweb.org/download/file.php?id=97981) from the [A2+ documentation wiki](https://wiki.freecadweb.org/A2plus_Workbench).)

Issue History

Date Modified Username Field Change
2020-07-02 14:31 Fizik New Issue
2020-07-02 15:13 Fizik Note Added: 0014612
2020-07-07 16:22 openBrain Note Added: 0014625
2020-07-07 21:37 Fizik Note Added: 0014633
2020-07-07 21:38 Fizik Note Edited: 0014633 View Revisions