Comments (11)
Ok. Thank you for feedback. I Will search for known issues when porting python code from mac OSX to windows 10.
Which pyphs version are you using? You can get it with
import pyphs
pyphs.__version__
from pyphs.
I am using 0.1.8
Somehow I get the same error with Linux (Debian 8) and pyphs 0.1.8 :
Code
import pyphs
PHS = pyphs.PortHamiltonianObject(label='label', path='path')
Error
Traceback (most recent call last):
File "<ipython-input-27-96d64029112b>", line 2, in <module>
PHS = pyphs.PortHamiltonianObject(label='label', path='path')
File "xxxx/.local/lib/python2.7/site-packages/pyphs/pyphs.py", line 93, in __init__
from symbolics.symbols import Symbols
ImportError: No module named symbolics.symbols
from pyphs.
Ok. It seems like the import method of submodules does not work. I changed the following in the development branch:
from symbolics.symbols import Symbols
to
from .symbolics.symbols import Symbols
to force the submodule search in the pyphs path.
Please, do the following:
- get the latest version on the dev branch of pyphs,
- with terminal, go in that root folder (that contains both a "setup.py", the "README.rst", and a "pyphs" folder),
- run a local PiP installation with:
pip install -e .
- in python, verify the pyphs version is "0.1.9b6_DEV"
- test if it this commit solves the import of submodules.
Thank you!
from pyphs.
Thank you, the local installation of the latest version completed successfully.
Unfortunately I get the same error (Debian 8) :
Code
import pyphs
print(pyphs.__version__)
PHS = pyphs.PortHamiltonianObject(label='label', path='path')
Output
0.1.9b6_DEV
Traceback (most recent call last):
File "<ipython-input-4-1b4ee30b4c7e>", line 1, in <module>
runfile('xxxx/test.py', wdir='yyy')
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 580, in runfile
execfile(filename, namespace)
File "xxxx/script.py", line 10, in <module>
PHS = pyphs.PortHamiltonianObject(label='label', path='path')
File "xxx/.local/lib/python2.7/site-packages/pyphs/pyphs.py", line 93, in __init__
from .symbolics.symbols import Symbols
It seems that all paths have to be addressed in an absolute way : from pyphs.symbolics.symbols import Symbols
from pyphs.
I suspect a deepest problem.
However, to oust this question, please can you try the latest version on the dev branch of pyphs, which should be "0.1.9b7_DEV"? (same procedure as above). This last commit includes your solution:
from pyphs.xxx import blablabla
But, I would worry if it works...
from pyphs.
I installed this new version, but I still get the same result.
Here are the contents of the installed package :
help(pyphs)
Help on package pyphs:
NAME
pyphs
FILE
XXXX/.local/lib/python2.7/site-packages/pyphs/__init__.py
PACKAGE CONTENTS
config
metadata
paths
pyphs
I wonder if the modules (Symbolics, plots ...) are included in the package ? Should they appear explicitly in the package contents ?
Note : I don't know if that makes a difference, but I have used the following code for the installation (instead of pip -e) :
pip install --user XXXX/pyphs-dev.zip
from pyphs.
Maybe this stack overflow question could help.
This topic states that sub-packages should be declared in the setup.py file.
from pyphs.
Sounds good!
We should have a look to this reference which is pointed in the above stack overflow question.
from pyphs.
I made the appropriate changes in the last commit in the dev branch with version "0.1.9c0_DEV"
Hope it will close this issue
from pyphs.
It works well !
Good job !
Code
import pyphs
dlc = pyphs.PortHamiltonianObject(label='dlc', path='label')
dlc.build_from_netlist('dlc_netlist.net')
dlc.texwrite()
Output
*** Realizability analysis succeed ***
from pyphs.
Thank you for finding the issue, and the solution!
Issue closed
from pyphs.
Related Issues (20)
- Python doesn't raise errors if the C++ compilation fails HOT 2
- Debug module for NL solver convergence issue
- Unfold the evaluation of implicit function in NL solver
- Complexity of FAUST code is to high for more than 2 NL components
- Externalize the modules for LATEX/JUCE/FAUST code generation HOT 2
- Discarding linear part of a quadratic Hamiltonian HOT 5
- Account for linear part of Hamiltonian of linear components in latex rendering system HOT 1
- matvecprod ShapeError in Typical use HOT 3
- minor warnings related to manifest HOT 2
- Rhodes Example: TypeError: can't convert expression to float HOT 2
- Memory issues for huge number of samples HOT 7
- Add rotary mechanical elements to PyPHS HOT 3
- Improve time to plot data HOT 2
- Issue when installing PyPHS HOT 3
- redefinition of symbols are not allowed HOT 3
- 'NodeView' object has no attribute 'index' HOT 5
- AssertionError: flux-controlled edge xBSC1 is effort-controlled I don't understand HOT 2
- Is it possible to define a state feedback control (u = k*x) for the simulation? HOT 4
- Eigen stack allocation limit
- C++ code feature: CMakeLists.txt template HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyphs.