I am trying to setup myHDL with Python2 on Windows 10 in order to work with VHDL/Verilog testbenches using Python for the source code. The corresponding instructions can be found here.
I have successfully installed python, pip and then myHDL on my system. Now to setup co-simulation, I can't make sense of the instructions given:
Co-simulation requires an additional installation step.
To install co-simulation support:
Go to the directory co-simulation/ for your target platform
and following the instructions in the README.txt file.
Which directory is being referred to here? I can't find a co-simulation directory after installing myHDL in my C:/Python27 directory/sub-directories.
The FAQ section addresses this issue by suggesting the use of Cygwin. Can someone suggest how to implement this or if there is an alternative method that I can work with?
The cosimulation directory can be found in ~/.local/share/myhdl directory.
For my Cygwin installation, it was here:
/usr/share/myhdl/cosimulation
Related
I'm trying to write simple a python script for samba user management. I found this documentation with an example. This example uses a lib named "SAMR" (import samr). I have no idea where to get it or how to install it.
It does not exist in pip or easyinstall. Only samba setup.py file google finds is from 2007. I found a package name python-samba in debian repos, but I'm an arch user. There no such package in AUR or official repos.
Thanks
That code has since evolved. It is now located in samba.dcerpc.samr.
Every modern full Samba installation (like the one in arch) should come with the Python modules, though arch may install them in a non-standard path.
I have a general question using third party libraries, but I will exemplify it on two examples to make it clearer and more "answerable":
I want to use pyfmi in Python. Trying to install it through pip tells me:
"Exception: FMI Library cannot be found. Please specify its location, either using the flag to the setup script '--fmil-home' or specify it using the environment variable FMIL_HOME."
I figured out that I had to download the tar.gz from jmodelica.org and extract the files, create a build directory, use cmake, make and make install commands. All runs through without a hitch. But trying to install through pip gives me the same error message. So my question is:
How does one do this? Do they mean by setup script the setup.py file? How can I access that one if I am installing through pip?
An which one is the fmi home directory? Is it the untarred file in my Downloads-Folder or one of the files in it:
builddir
Config.cmake
install
src
Test
ThirdParty
CMakeLists.txt
FMILIB_Acknowledgements.txt
FMILIB_License.txt
FMILIB_Readme.txt
LICENSE.md
README.md
? What is that flag and where to put it "exactly".
Thanks a lot.
PyFMI requires (as noted on the PyPI site) that FMI Library is installed prior to trying to install PyFMI from source.
During the installation (invoking python setup.py install) of PyFMI, the environment variable "FMIL_HOME" is checked to see if that points to an installation of FMI Library, if so, this will be used during the installation. So in your case, you need to set this environment variable. The other option is to install manually (using python setup.py install --fmil-home="/path/to/fmil") where the added path should point to FMI Library.
The third option is to see if there are binary installers for your platform (these include FMIL). Check PyPI, Anaconda and Christoph Gohlke's site.
I need to support some software that is using an old Python version (2.4). So I have downloaded and compiled Python 2.4 and installed it in a virtualenv. So far, all OK and normal procedure.
But the software is trying to import an rpm module. And I cannot find a source for that module (it is not part of the standard Python library, afaict).
Typically, once the virtualenv is enabled (source env/bin/activate) I can install required software using easy_install. But easy_install rpm is failing to find anything. There is a pyrpm module, but it is not the same thing (it installs a module called "pyrpm"). And google searches are useless, as they all link to articles on how to build rpms...
If I were using the system python (on Ubuntu) I could install the python-rpm package. But that is for Python 2.7. How do I install the equivalent for Python 2.4?
[My impression is that the rpm libraries, used by many Linux systems, include a Python library, which is packaged as python-dev by the distro. But I can't see how to access that for an arbitrary python version.]
I AM NOT LOOKING FOR AN RPM THAT CONTAINS PYTHON 2.4. I AM LOOKING FOR A MODULE NAMED rpm THAT IS USED BY SOFTWARE WRITTEN FOR PYTHON 2.4.
It's right there, in the python-rpm RPM package:
http://rpmfind.net/linux/rpm2html/search.php?query=python-rpm
You will probably want to download the package contents, extract them, and then use
python setup.py install
From your active environment.
Of course, as it's pre compiled, you might have trouble getting the C extension to run.
I'm not familiar enough with RPM's to know whether you can get the source from there.
No guarantees the package will work with your python version though.
there's no simple way to do this; the python library is part of the system rpm package and interfaces to C code, so is closely tied to the rpm package installed on your machine.
instead, it's much simpler to install an old OS in a VM (eg CentOS 5) that uses Python 2.4. then everything is consistent and works.
the sources for the rpm module can be found here: http://www.rpm.org/wiki/Download
After you download the wanted version read and follow the INSTALL instructions in order to compile it on your target OS. Afterwards make sure you add the correct path to the 'site-packages' folder the installation chose into your PYTHONPATH environment variable.
To test start your python interpreter and run 'import rpm'
HTH,
Ran
I am trying to find a way to include a library in a Ubuntu/Python/PyGtk application even though It is not included in the stock python enviornment and I can't add it as a dependency in my setup.py file. The library is called pygal and does have a PIP package (No available .deb or ppa) but I was looking for a way to include it in my application. I would think I could just include the source .py files to the library but I am unsure of how to go about including it in my code. Pygal also requires the lxml python library. I can install it via pip on my machine and it works fine but didn't know if there was anyway to automate or include this in my .deb package's setup.py file. Any help or advice would be greatly appreciated.
I think this should work though I'm not sure.
You put the folder with the name pygal from the pygal egg in your application directory. You can take it from your python installation - it should have this path:
/usr/local/lib/python2.7/dist-packages/pygal-0.13.0-py2.7.egg/pygal
or if you use python 3.1
/usr/local/lib/python3.1/dist-packages/pygal-0.13.0-py3.1.egg/pygal
or download it from pipy.
You can use it like any python library:
from pygal import *
I've actually figured out how to package this as a *deb file that I can include in my future PPA (or possibly submit to the community) that will (hopefully) cleanly install the python package on the system. I found a great write up in the Debian wiki that actually doesn't seem cryptic to a newbie like myself, oddly enough.
http://wiki.debian.org/Python/Packaging#Example_1:_Python_extension
I downloaded python sources. When I do configure, everything fine, but when I do make, it says that Tcl/Tk library not found. Where can I find all packages required by python?
Thanks in advance.
Look at the DSC file for the Ubuntu python2.7 package to find the Build-Depends and apt-get install all of them before building Python.
http://www.tcl.tk/software/tcltk/download.html
This has worked every time I needed it to. Make sure to read the INSTALL and/or README files as I remember it has a somewhat non-standard method of installation...