[x3d-public] Problem with x3d.py location?

Don Brutzman brutzman at nps.edu
Tue Apr 21 21:05:57 PDT 2020


Yes you have a problem with location, due to incorrect installation or configuration.

python is not seeing the x3d (x3d.py) package.

As described yesterday, the X3DPSAIL page describes two paths where you either play like a user or a local developer.

Each converted X3D -> Python program has a similar setup description in the comments:

###############################################
#
# Now available: developmental python x3d.py package on PyPi for import.
#   This approach greatly simplifies Python X3D deployment and use.
#   https://pypi.org/project/x3d
#
# Installation:
#       pip install x3d
# or
#       python -m pip install x3d
#
# Developer options for loading x3d package:
#
#    from x3d import *  # preferred approach, terser source that avoids x3d.* class prefixes
#
# or
#    import x3d         # traditional way to subclass x3d package, all classes require x3d.* prefix
#                       # but python source is very verbose, for example x3d.Material x3d.Shape etc.
#                       # X3dToPython.xslt stylesheet insertPackagePrefix=true supports this option.

from x3d import *

###############################################

If you look at the logs, you see how my machine is set up by setting PYTHONPATH.

Good luck!


On 4/21/2020 1:33 PM, John Carlson wrote:
> I copied x3d.py into my source folder, and I got this error on the attached file.  These files were produced by X3dToPython.xslt
> 
> I think we've seen this before. My recommendation is to reduce the abox.py file to the minimum, just the import to test.  Then you won't be concerned with the scenegraph.
> 
> John
> 
> $ python net/x3djsonld/data/abox.py
> Traceback (most recent call last):
>    File "net/x3djsonld/data/abox.py", line 21, in <module>
>      from x3d import *
> AttributeError: module 'x3d' has no attribute 'SFBool'
> 
> coderextreme at DESKTOP-DOPK2VD MINGW64 ~/X3DJSONLD/src/main/python (master)
> $ ls net/x3djsonld/data/X3d.py
> net/x3djsonld/data/X3d.py

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list