I am trying to install the sba's python wrapper (https://pypi.python.org/pypi/sba) on windows 10. Is there a simple, easy way to do this? This is my last resort, I just wish to know if someone has been able to figure it out. I know it is able to be done in linux and looking through the source files of the library it seems as if it can be done in windows, but no concrete documentation is presented.
Some of the instructions provided by the library's website and source text files say one has to download the original sba library, which is written in c, and compile it as a shared library, a dll library in windows. I have been trying to achieve this using cmake and visual studio 2015 without success.
If somebody has done this or has some insight in the problem I will be very grateful for it to provide the solution.
Thanks!
Related
I'm attempting to access functions in pickits.dll (32bit .NET library) located in the same directory as the .py file.
The library is developed by Microchip for low-level access to some of their hardware through USB. The dll and documentation in pdf format can be downloaded here: https://www.microchip.com/en-us/development-tool/DV164122
Fruitlessly I have been spending the last 5 hours going through all the dll access options I have been able to find online. I have found proof that the library has been accessed through Labview, so I believe it should be possible...
However, I'm starting to doubt it's possible from Python.
I have tried ctypes, pydotnet and pythonnet, and now believe https://github.com/tr8dr/.Net-Bridge is the most promising to use, but I simply can't figure out how to use it. Something even better may exist, please let me know.
I've tried with Phyton 3.9.4 MSC v.1928 64 bit (AMD64) on win32, installed through PyCharm. (Note, I am using Win10/64)
Ideally, I need a simple step-by-step guide, covering:
What modules do I need to install, and how to install them correctly?
Example Python code.
Anything else that I might not yet know to ask about?
Thanks in advance.
I've looked around (including StackOverflow) but can't really find something similar to my case so I'll just ask it here. I'm building an application with Python (it is currently a source code that I'm planning to turn into a Windows executable) and is using this library: https://github.com/xiph/rnnoise. It is not a Python package but a third-party library written primarily in C.
Since I have to install it into my computer in order to use the library inside my code, I want to ask if there is a way to include this library along with the executable so that anyone can just download and use it without having to set up the library? This is important since I can only set up the library on a Linux machine and the executable needs to work with the library platform-independently.
Update: Thanks to Vimalan E and Marat, I had a bit more clue on what I need to do. I was managed to locate the .so files of my required library after running make install on it. The question left is I don't know how to link it with an executable that will be made from my Python source code. For now, I want to include the library as a binary file along with my application (though I am not sure how to achieve that, maybe putting putting the .so near the .exe should do the trick).
Thank you.
I am a novice to both Python and Linear Programming. I currently have Python 3 on my device through Anaconda, and I have downloaded all the installation files for GLPK and PyGLPK. I have also installed the glpk condo package multiple times. Despite all of this, I find myself unable to interpret GLPK .lp files on any Python API, such as the jupyter or sublime text; i.e. I cannot import glpk. Previous answers have recommended using PyGLPK in order to get around this, but it only functions on Python 2. PuPL was also recommended as a tool that is able to interpret .lp files, but I haven't been able to make that work (PuLP works fine on both my command prompt and anaconda, but it cannot interpret .lp files, only create them). In essence, I have two fundamental questions.
Is the Anaconda GLPK package functional? A few of my peers have also found trouble getting it to work.
Are there any tools that allow you to build, and more importantly read .lp files through Python 3?
Thanks in advance!
After searching for a long, I finally found Python-MIP to be a good solution to this.
Other more cumbersome and not well-documented options are using commercial APIs for IBM CPLEX or Gurobi, especially if you are targetting a massive problem. They both have free demo licences for limited problem size.
I have been trying this for hours now, but cannot seem to get this right. I am trying to download Pocketsphinx for use of command recognition in Python.
So first thing I did was attempt to install SphinxBase, which is required for Pocketsphinx to work. So here we go. I downloaded the files, the tar.gz zip. I followed the instructions in the README document in order to install on windows.
To compile sphinxbase in Visual Studio 2010 Express (or newer):
1, unzip the file.
2, rename the directory to sphinxbase
3, go into the sphinxbase folder and click sphinxbase.sln
4, in the menu, choose Build -> Rebuild All -> Batch Build -> Build
I have never used visual before, but it seemed pretty self explanatory. First thing I did was unzip and rename. Next up I opened the SLN project in visual, selected all 6 projects, the Files>Build Selection. It build with all 6 projects succeeding. Great, that's done. Now was that really all? I had to do?
Next up was PocketSphinx. I downloaded the tar.gz again, and basically did the same process.
* load pocketsphinx.sln in pocketsphinx directory
* compile all the projects in PocketSphinx
All builds succeeded in being built. So... done, right? After this, I am lost. Most tutorials stop here and do not actually go into using Pocketsphinx in other languages. I need to be able to use it in Python.
So I did some digging around and found a setup_win32.py file under pocketsphinx/python. I tried to run this in the command prompt but go multiple errors. Now I am running windows 64 bit, but could this cause this issue?
http://hastebin.com/japobecusi.tex
So all in all, I just need help getting this to work with Python. I am very inexperienced in these things currently. Thanks
One more thing, I am considering switching to my Ubuntu Linux partition in order to almost make it easier on myself. Most programs, including this one, seem to only use windows 32, like 64 is unacceptable apparently. So would it benefit me to move over to a Linux platform to work in Python? Would it be easier?
Thanks for any help in advance.
It is not that trivial to build python with swig on windows. You can just pick latest prebuilt binaries here:
https://pypi.python.org/pypi/PyPocketSphinx/12608
At the corresponding repository https://github.com/bambocher/PyPocketSphinx you can find more detailed manual on how to build it.
Please note that for latest features you need a latest pocketsphinx version from github/subversion repository, a packaged 0.8 is not going to work.
Switch to Linux is also a good idea.
I've spent countless hours trying to understand this and unfortunately I haven't gotten to an answer yet. Or at least I don't think I have.
First up I should say that I am a Java Developer. I've only recently started working with Python and the build-process is a bit...odd for me.
In my mind I write an application, I compile it to run and I package it into a .jar for other people to use. Either as a library or for end-users to execute and have fun with it. (ignoring stuff like maven or gradle...)
I wrote a little CLT in python that consists of ~6 files and I wanted to distribute it. From what I could find I was supposed to write a setup.py and I found some guides on how to do that but ... to be honest I'm not even sure what that did. I could get my source code bundled into a tar.gz with some other meta data or it would create some weird files that I don't know what to do with.
Then I found PyInstaller and it worked great to package everything into a binary. However I've run into some problems trying to create a Debian package and it has made me re-assess and question the fact that there doesn't seem to be something in Python (without having to use an external tool) that lets me package/ bundle/ whatever my application into a single file to be run.
And that's something I can't get my head around. I mean...before there were tools like PyInstaller and P2Exe and what not, how did people distribute their applications? Am I expected to write a C application, somehow include the python code in there and compile that? Sorry if this seems like a stupid question but I'm really asking. I've googled around so much and spent so much time on it and haven't found a satisfactory answer so I hope someone here can help me with this! Thanks.
If you package your Python code for pip, you can include some executable scripts that start your program. I don't know how the situation was 5 years ago when this question got asked, but nowadays pip is pretty much integrated with Python, to the point that there's a standard library module to bootstrap pip in case it's missing:
https://docs.python.org/3/library/ensurepip.html
The situation is different if you want to package an application for some other package manager, like Anaconda or the package managers of various Linux distributions, or as a Windows installer. Obviously, you'll have to create a separate package for each package manager or installation technique you want to support.