Whenever i try to pip install pyleargist, it gives me this issue.
Is there a version compatible with python 3 ?
Can someone help on this ?
The library was last updated in 2012, see the pypi page and as you already noticed, the issue you are seeing is based on the fact that it was written for python 2. In this case, file seems to be used in the setup.py, which was removed in python3. For this exact library, it seems to be stale, so no other versions.
You have two options:
It does not look to be a large library, you could download the source code from pypi and try to fix the python 2/3 issues.
Search for another library. A google search shows several options for python libraries that can compute the GIST descriptor. Just look for another one that fits your requirements
Related
I'm trying to run a face detection model in Unity. It gets input from the webcam, then spits out a face. But trying to make this work with C# has been an absolute nightmare. And despite all my suffering, I still haven't been able to make it work!
If I could use python, I'd be able to get it done easily. So, obviously, I want to find a way to get a python script working in Unity. But IronPython is the only thing I've been able to find, and it's outdated.
I need either knowledge of how to make IronPython work in spite of being outdated, or some other method. Please.
Unfortunately, Unity at this time does not support Python. Although, there is an asset that you can use a bit of Python with. I am not sure what you can do with this asset but I know it could help a minimal amount:https://assetstore.unity.com/packages/tools/integration/python-interpreter-645
Quick Note: Most programming languages work about the same way. If you figure out the documentation and grammar/punctuation for C#/UnityC#, you should be off just fine.
I try to use python once on Unity and I found a few ways:
There is a package call "IronPython" where you can add a python file to your unity project and then call a function from C# to your python code, to do that you should follow this:
We already know that we can use python to use .net internal calls.
Now we may use the same to start a console that can accept a scripting language in Unity engine.
To do this we have to include certain dll files.
These dll files must be present in Assets>plugins
IronPython.dll
IronPython.Modules.dll
Microsoft.Scripting.Core.dll
Microsoft.Scripting.dll
Microsoft.Scripting.Debugging.dll
Microsoft.Scripting.ExtensionAttribute.dll
Microsoft.Dynamic.dll
Once the Plugins are in place.
Initiate the Cs code
PythonEngine engine = new PythonEngine();
engine.LoadAssembly(Assembly.GetAssembly(typeof(GameObject)));
engine.ExecuteFile("Test.py");
Where test.py is the python code.
Initiate python side:
import UnityEngine from UnityEngine
import *
Debug.Log("Hello world from IronPython!")
References:
https://github.com/cesardeazevedo/Unity3D-Python-Editor
http://techartsurvival.blogspot.in/2013/12/embedding-ironpython-in-unity-tech-art.html
IronPython in Unity3D
the issue with this way is that most of the python module are not supported.
2.the second way is to create a file like json that contain the data you want to send to the json and then create an output json that send the output from the python script, this way is very limited with what you can send because the data must be contain in your json.
the last way that work for me is to install the Nuget package and copy the script from python to c# line by line with the relevent module installed in Unity and it's work for me, but copy a long code can take time.
this is a reference to the package:
https://github.com/GlitchEnzo/NuGetForUnity
and then to install the relevent package you should press on NuGet → Manage NuGet Packages and the choose the relevent package(for me it was Numpy and it work grate).
hope it will help you
I don't know how recent it is but there is a Unity package for python available on unity 2019.3 and further versions.
Warning the first versions of this package can't use Python3.
You can see more for yourself by the following link.
https://docs.unity3d.com/Packages/com.unity.scripting.python#2.0/manual/index.html
I hope this may help you.
We are thrilled to announce that Python for Unity 4.0.0-exp.5 is now available!
4.0.0-exp.5 is a major upgrade from our last public release, and incorporates a large number of changes. In summary:
Based on Python 3.7; scripts based on Python 2.7 will need to be ported.
Users no longer need to install Python on their system.
In-process Python is no longer reinitialized when the Unity domain reloads.
Removed the out-of-process API. The PySide example now runs in-process and is much simpler.
Limited support for a virtual environment workflow via the ProjectSettings/requirements.txt file.
Many bug fixes.
Documentation for the Python for Unity package is available here, and the full changelog can be found here.
This is an experimental release, and thus is not visible in Package Manager. To install this package, open Package Manager, click the + at the top left and select Add package by name.... Enter com.unity.scripting.python as the name and and 4.0.0-exp.5 as the version and click Add. Alternatively, you may edit Packages/manifest.json and add "com.unity.scripting.python": "4.0.0-exp.5", to the list of dependencies, or edit the existing entry for Python for Unity to update the version.
Soursce: https://forum.unity.com/threads/python-for-unity-release-announcements.1084688/
Documentation: https://docs.unity3d.com/Packages/com.unity.scripting.python#4.0/manual/index.html
Unity not supported python, But you Can write Python Code and run it by Socket programing, Create Server with python and send data,in C# Connect to server and use data sended with python.
I have to upgrade my application's python version from 2 to python 3.
how i can check all python 2 library dependencies. Whether it will break any libs dependencies in python 3.
any suggestion over this will be appreciated.
Currently checking with -
Python2to3- Code fixer used to correct language syntax and annotator.
Pip check - collects all libs and its version dependency.(Not working for me in server)
CanIusepython3- Python module.
pipdeptree - But how it will tell me whether package version compatible with python3 or not.
You could try using this library:
https://docs.python.org/2/library/2to3.html
If it does not do a well good of a job, you can always try manualy. It's an incremental process so you would need to change things slowly.
Used modules
An automated tool can probably not give you complete information, for several reasons;
Some modules have changed name or usage between Python 2 and Python3 compatible versions.
Some modules might not have been updated for Python 3, but alternatives exist.
So I would suggest the following. Using e.g. egrep, extract all the import statements from the applications code. I would use something like this (from the source code directory):
egrep -Rh '^import .+|^from [^\.].+ import' . | sort | uniq
If your operating system doesn't support these tools, you can easily write a small python script to extract import statements from all your code files.
Once you have a listing of all imports, disregard modules that are part of the standard library or that are part of the application.
For the remaining external modules you will have to search online and check if there is a Python 3 compatible version or alternative.
Converting your code
As mentioned, 2to3 can do most of the changes that can be automated for you.
For the rest I would recommend using a good code checker like e.g. pylama and an automatic code re-formatter like e.g. yapf.
I would like the most advanced version of Python that still works on Windows XP. I need both Python 2 and Python 3.
What versions of Python will work on Windows XP?
I found that Python 2.7.9 and Python 3.4.4 are the newest versions of Python that work in Windows XP. I found this out through trial and error.
I've found a desperate guy (Daniel Pistelli) who didn't give up at the windows error dialog:
https://ntcore.com/?p=458
I like how he approaches the topic:
If we try to start any new application on XP, we’ll get an error
message informing us that it is not a valid Win32 application. This
happens because of some fields in the Optional Header of the Portable
Executable.
[...]
Fortunately, it’s enough to adjust the fields in the executable we want to start (python.exe), there’s no need to adjust the DLLs as well. If we try run the application now, we’ll get an error message due to a missing API in kernel32. So let’s turn our attention to the imports.
And then he goes on for another 5-6 screens. To sum it up, apparently you'll have to:
Modify the python.exe header,
Run a tiny Python script to remap some DLL calls,
Recalculate some binary hashes,
Create a fake kernel32.dll with certain calls forwarded,
Modify python37.dll to point to this fake thing,
and then you're all set. To be honest I couldn't quite follow (let alone verify!) some of the steps but it looks legit and there are links with Daniel's half-baked solutions for the harder parts, also a lot of Python sources explained. I will definitely give this thing a try.
In fact, here are the final scripts from his GitHub page:
https://github.com/dpistelli/xptmrt
Moral of the story: you can be crazy, but you'll never be dismantle-all-dlls-and-exes-and-open-hexeditors-and-disassemble-hashing-algorithms-and-mock-it-all-together-so-it-works-under-xp-crazy!
Someone had built Python 3.4.10, which is slightly newer than the officially prescribed Python3 v3.4.3/3.4.4 for Windows XP. Since it comes from the third-party (not the official Python website), use at your own risk,
-->Download<--
i tried 3.3.3 but i came up with an error message use 3.4.3/2.7.9 they are the only versions that work now sadly
There are several custom builds of Python >3.44 suitable for Windows XP. A poster at reddit has provided Python 3.55 here:
https://www.reddit.com/r/Python/comments/3tgi0t/python_35_x86_on_windows_xp/
Here is an XP compatible build of 3.6.15 source code only:
https://alex-free.github.io/winxp_python3.6.15/
At the MSFN forums someone has provided an XP compatible build of 3.8.1350 here:
https://msfn.org/board/topic/183741-python-3813-for-windows-xp-sp3/
Official website says about 3.4.10: https://www.python.org/downloads/release/python-3410/
Any of them, python is very platform independent. Some features might not work, but that would best be found in the documentation.
I am trying to install via pip install a python module. But when I do it, it gives me this:
RuntimeError: Required library Boost not found.
Now, I have already downloaded boost. I put it in program files/boost (hopefully that is how it's done because the boost web page doesn't give much detail on the installation except to download and extract). So I am not sure what the problem is. I have tried to do cd program files/boost, but that doesn't work either. The instruction from the documentation is pretty vague too.
First time I am doing this, so I can't tell if what I am doing is dreadfully wrong or not.
Now, I have already downloaded boost. I put it in program files/boost (hopefully that is how it's done because the boost web page doesn't give much detail on the installation except to download and extract)
No, that's not how it's done, and that's your problem.
Also, I don't know where you got the idea that the Boost web page doesn't give much detail on installation. There's a huge Getting Started document.
Of course that documentation tells you how to build C++ programs that you're writing against Boost; it doesn't tell you how to convince Python to find it for modules that depend on Boost.Python. That's in the Boost.Python docs.
Also note that Christoph Gohlke's unofficial Windows Python Binaries includes a boost.python package, which installs all the Python-side runtime stuff for you, which makes it a bit easier.
This isn't simple. (It's a lot simpler on Unix systems (including Macs), where, as long as you install a C or C++ library into some standard path, every other program can find it.) But I doubt anyone is going to be able to provide a better tutorial in a StackOverflow answer than the one in the official docs, so you're just going to have to read them.
How can I run online python code that owns/requires a set of modules? (e.g. numpy, matplotlib) Answers/suggestions to questions 2737539 and 3356390 about interpreters in python 3, are not useful because those compilers don't work properly in this case.
I found one that supports multiple modules, i checked numpy, scipy, psutil, matplotlib, etc and all of them are supported. Check out pythonanyware compiler, a sample console is here, however you can signup for accounts here, i believe there is a free version. I remember i used that that online compiler last year and it worked quite well, but for a free account it has certain limits. It also has a bash console, which allows you to run the python files.
You may try this as sandbox, it support numpy as well: http://ideone.com
You can try one of the best editors I found on internet , which has not only your requirements but more than that.
Here is the link - Replit