Comments (17)
When I comment out logging, I run into another error
Traceback (most recent call last):
File "examples/diode/diode-characteristic-curve.py", line 25, in
libraries_path = os.path.join(os.environ['PySpice_examples_path'], 'libraries')
File "/usr/lib/python3.3/os.py", line 676, in getitem
raise KeyError(key) from None
KeyError: 'PySpice_examples_path'
from pyspice.
-
For some reason logging.yml was not installed in PySpice/Config
-
You are facing path issue
You have to setexport PySpice_examples_path=<path to example directory>
you can look at setenv.sh
from pyspice.
Have the same issue with missing Loggin.yml
in /usr/lib/python3.4/site-packages/PySpice/Config
.
Tried the Github-search to find it ...
- 2x issues found
- 2x source files found using "logging.yml" ... but no reference to "logging.yml" ... not clear why it's not shown
BUT it is definitely in the repo ... because it is available at
https://github.com/FabriceSalvaire/PySpice/tree/master/PySpice/Config
My Environment: Win7 + cygwin-64 + (Python3.4 just for PySpice, was difficult to get Numpy installed)
Installation: setup-x86_64.exe (cygwin-64)
or python3 -m pip install <module>
from pyspice.
https://github.com/FabriceSalvaire/PySpice/tree/master/PySpice/Spice/NgSpice/api.h seems to be the same issue. It's in the repo but missing after the installation.
from pyspice.
After the installation ./NgSpice looks like this
$ ls -1 /usr/lib/python3.4/site-packages/PySpice/Spice/NgSpice
__init__.py
__pycache__
Shared.py
$
from pyspice.
These files are installed by the following lines in setup_data.py:
data_files=[
(os.path.join(PySpice_path, 'Config'),
[os.path.join('PySpice', 'Config', 'logging.yml')]),
(os.path.join(PySpice_path, 'Spice', 'NgSpice'),
[os.path.join('PySpice', 'Spice', 'NgSpice', 'api.h')]),
],
I don't know why it doesn't work on your platform. Path issue on Windows?
You could also try the anaconda distribution to install Python on Windows.
from pyspice.
Keep in mind I'm using cygwin-64 on Win-7.
Installation: python3 -m pip install PySpice
AFAI can tell there is not setup_data.py
in my /usr/lib/python3.4/site-packages
.
Checked with find /usr/lib/python3.4/site-packages -ls | grep -i setup_data
.
BUT more find-calls exposes a surprising location of the missing files ... found it at
/usr/lib/python3.4/site-packages/usr/lib/python3.4/site-packages/PySpice/Config/logging.yml
/usr/lib/python3.4/site-packages/usr/lib/python3.4/site-packages/PySpice/Spice/NgSpice/api.h
It looks like the path to ./site-package
is inserted twice ... just for the two files marked as missing. No other files in this location.
from pyspice.
According to https://docs.python.org/3.5/distutils/setupscript.html#installing-additional-files, it can happen if the starting / is missing on your platform (which is not a native Posix OS).
Try to execute these Python lines to check it:
from distutils.sysconfig import get_python_lib
site_packages_path = get_python_lib()
print(site_packages_path)
Note cygwin is quite special and not bug free.
This issue has to be checked on a standard install on Windows (it means using native Windows path).
from pyspice.
At this point there is a bumper on the street. No chance to get a Python3 installed within my native Win7 to keep my Py2.7.12 setup clean.
Based on the PySpice Py3-requirement it makes less sense (for my opinion) to check it in my Py2.7.12 native Win7 setup ... except you are saying it's worth an installation check in Py2.7.12.
cygwin-64 @ Win7 ... installed Jul/2016 (using most recent packages available)
$ python3
Python 3.4.3 (default, May 5 2015, 17:58:45)
[GCC 4.9.2] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.sysconfig import get_python_lib
>>> site_packages_path = get_python_lib()
>>> print(site_packages_path)
/usr/lib/python3.4/site-packages
>>>
>>> import os
>>> os.linesep
'\n'
>>> exit()
$ python
Python 2.7.10 (default, Jun 1 2015, 18:05:38)
[GCC 4.9.2] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.sysconfig import get_python_lib
>>> site_packages_path = get_python_lib()
>>> print(site_packages_path)
/usr/lib/python2.7/site-packages
>>>
>>> import os
>>> os.linesep
'\n'
>>> exit()
from pyspice.
It looks like something goes wrong in distutils on your platform since the path is considered as a relative one. It could be related to Cygwin. Unfortunately I don't have Python on Windows to check it.
Anyway you can copy manually these files to test PySpice further.
from pyspice.
After knowing where the files are it is an easy task to copy.
Maybe it helps your (or maybe not) ... have scanned my hardware. All Python inst. return absolute paths.
Both Win7Pro installations (Py2.7.12 and a hidden Py3.5.2)
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
>>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.sysconfig import get_python_lib
>>> site_packages_path = get_python_lib()
>>> print(site_packages_path)
C:\Programme\Python\Python2.7.12\Lib\site-packages
>>>
>>> import os
>>> os.linesep
'\r\n'
>>> exit()
>>
>>C:\Programme\Python\Python35\python.exe
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.sysconfig import get_python_lib
>>> site_packages_path = get_python_lib()
>>> print(site_packages_path)
C:\Programme\Python\Python35\Lib\site-packages
>>>
Linux PC (Ubuntu 16,04.1, fresh install from iso-image) returns absolute paths as well
Py2.7.12 : /usr/lib/python2.7/dist-packages
Py3.5.2 : /usr/lib/python3/dist-packages
from pyspice.
Just to clarify, I provide to the installer an absolute path, but it is considered as a relative one in your platform (it is why you get this funny path /usr/lib/python3.4/site-packages/usr/lib/python3.4/site-packages/...), which isn't expected.
Could you check, the isabs function return effectively True :
import os
os.path.isabs(path)
.
from pyspice.
os.path.isabs(path) ... path is not defined in the this 2-line checker
from pyspice.
If you ask for this path ...
>>> from distutils.sysconfig import get_python_lib
>>> site_packages_path = get_python_lib()
>>> print(site_packages_path)
/usr/lib/python2.7/site-packages
>>> os.path.isabs(site_packages_path)
True
>>>
from pyspice.
Yes for site_packages_path on Cygwin.
from pyspice.
I have the same problems.
You are facing path issue
You have to setexport PySpice_examples_path=<path to example directory>
Where is this example directory? It is not installed by pip? I have to manually download the examples from Github and create this directory myself? If so, it should say so in the documentation.
At this point there is a bumper on the street. No chance to get a Python3 installed within my native Win7 to keep my Py2.7.12 setup clean.
Anaconda can install Python 2 and 3 side-by-side.
from pyspice.
Where is this example directory? It is not installed by pip? I have to manually download the examples from Github and create this directory myself? If so, it should say so in the documentation.
You are right, examples are not installed by pip. You have to clone the repo or download the archive.
from pyspice.
Related Issues (20)
- How to run many simulations in parallel HOT 2
- Bug when using "save all" HOT 1
- ac analysis not working for NgSpiceShared
- Nonfunctional Discourse Link HOT 1
- How to retrieve .measure results HOT 1
- Would you like another active project mantainer? HOT 1
- B source : how to define a current-dependent voltage source HOT 1
- AWS Lambda: OSError: cannot load library 'libngspice.so' HOT 4
- Question about the GPL license
- Using `circuit.simulator(simulator='ngspice-subprocess',...)` breaks PySpice execution HOT 3
- _parameters deleted in wrong order
- pyspice-post-installation HOT 1
- Simulate circuit behaviour one time step at a time for code coupling. Issue with initial condition
- Bode diagram plot issue HOT 4
- analysis=simulator.operating_point() from voltage divider is not working HOT 2
- AC circuit using PySpice
- Gaussian and Exponential numerical codes are inverted for random source simulation
- Problem conducting ac_sensitivity analysis.
- Pyspice examples are not included in pre-release testing
- Importing Circuit class not working
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 pyspice.