I'm totally new in Python and I want to use the "shape context"-algorithm in Python. I saw on github that someone already made the effort to program this, but I think his program code was used with OpenCV 2 and it is not compatible with OpenCV 3.
Because of the missing experience I don't know how to fix his code to work on OpenCV 3.
I want to take this algorithm in Python because my previous programming is also in Python.
Please help me and don't be to rude if I made mistakes.
I would try using 2to3 library.
https://docs.python.org/2/library/2to3.html.
If it still doesn't work, You are left with either changing not working parts Yourself(asking someone who will do it for You) or using 2.7 interpreter.
Related
I have been looking at similar problems and everyone has a promising solution which usually revolves around changing the interpreter path. I have done my best but have run out of solutions that I can think of. I'm hoping someone else knows how and thank you for any comments.
No version of python ever appears, I have tried to enter the path in the box at the top but have had no luck
I want to switch from 3.10 to 3.9 and this is when not being able to select the version of python became a problem. The picture above is from the terminal within VS Code
This is the default path I have entered in VS Code
The photo above is from the Windows command prompt, locating the active version of python
I would like to be able to use Python 3.10 in some folders and 3.9 in others, however at the moment I really just need VS Code to see 3.9, I imagine once I know what has gone wrong at this stage it will be smooth sailing from here.
I have already uninstalled and reinstalled pretty much anything I can think could be related
I really hope I have just made a stupid mistake somewhere and it is really obvious, thank you again
so I'm pretty new to both swift and stack, but I have a problem with implimenting Pythonkit. But basically to provide a short summary, the kit basically allows you to be able to utilize python inside of swift (using certain swift functions in order to save variables, do functions, however, can execute the code of a .py file).
In the process of doing this however this error pops up
Fatal error: Python library not found. Set the PYTHON_LIBRARY environment variable with the path to a Python library.: file /Users/****/Library/Developer/Xcode/DerivedData/Y******L-
So I tried updating my Python software to 3.0 and above (I'm not quite sure, I think it was 3.7), however when I run python it shows it is at version 2.7. This kind of confused me a bit, however it was until the error did I notice something was wrong. Why does it show that error? What does it mean?
(I did find a similar post with a similar error in stack overflow, however I don't have enough reputation to comment as well as I don't think the answer was addressed to what I wanted so I'm just going to continue writing here)
The swift code itself has updated (xcode11) and following the steps a lot of the functions have changed within Xcode, what is it that I did wrong that caused the error? Following the link it seems I have to utilize pyto? Checking that link the functions of pyto are different than the ones pf PythonKit. In PythonKit you can utilize python within your swift code, while pyto seems to be a python integration for iOS?
Any advice? And please ask if anything needs clarification, or if there's a different solution please tell me. Thanks,Vince
Need some help converting the following to 2.7 from 3.6. Made it for someone now they want it in 2.7 :/ - Appreciate any help. Having a tough time. Some reason it is outputting all 0's - maybe some of the operators have changed?
https://hastebin.com/yazisebewa.md
You might want to try future statements. Basically, keep the code the way it is, and backport features to 2.7. I already see the print statements causing problems, so at the top just add from __future__ import print_statement. This will cause Python 2.7 to read print as if it were running in 3.x. Running the code through trial and error, backporting features as needed might be the best way to accomplish your goal. I will be happy to help with any further problems.
This topic is in response to a problem I've been having getting Pygame to be set up correctly on my computer. I have Windows 7, Python 3.3 and "64-bit" Windows (now I know what a bit and a byte are, but I don't really understand the implications of having a "64-bit" computer) I'm proficient in Python but know nothing about binaries, dependencies, registries or other such internal/system-level structures; not that I'm not interested, but at the moment most of what goes on is essentially "over my head".
But anyway, with that said, the problem I've been experiencing is basically that I can't install pygame. I've been over several versions of the same question (on Stack Overflow and other places on the web), and I've attempted to install pygame countless times. Sometimes it seems to work fine until I attempt to use it (the installation appears to have been successful but Python gives me errors when I try to use pygame), or I get something about Python 3.3 not being in my "registry" (which from what I read appears to be another OS-level/internal structure for those who understand "the base code of the universe"). They could actually develop a series of tutorials on just the installation process. :)
But all joking aside, I am at a loss here and considering just giving up on pygame. So my question would be, is there any way to use what's already installed (Python's libraries etc.) to develop games? If not, do you know of any alternatives that don't require the same level of experience to install? I've Googled around but everything I've found about game design in Python leads back to pygame. Thanks in advance.
To save yourself pain, just use 32bit python, and 32bit pygame. If you mix 32 and 64 bit, it will not run correctly. That's probably the problem you're having.
Since you have python 3.3, you would use https://bitbucket.org/pygame/pygame/downloads/pygame-1.9.2a0.win32-py3.3.msi
You shouldn't have to edit the registry or your environmentvariables unless something goes wrong.
As mentioned previously, tkinter would offer a solution. For example, this was created in tkinter (http://www.youtube.com/watch?v=RHxLkNryOzI)
The pygame downloads page hasn't been updated for a while and is incompatible with python 3.x. Newer versions of pygame can be downloaded here.
I'd personally use pygame as there's audio support as well but tkinter could be used.
I'm trying to run rst2odt.py and rst2wordml.py with Matti Pastelli's example on a Windows XP 32-bit computer. The R step works well, then I get the files ascii-example.rst, ascii-example.rst and ascii-example.pdf.
With Portable Python 2.7.3.1 I get the following errors:
With Portable Python 3.2.1.1 I get the following errors:
I am almost ignorant about the Python language hence I totally don't know what to do.
Not really an answer, but a couple of observations to look at
It's difficult to tell but two things stand out - the error you're receiving for the 2.7.x version is that print was a statement in the 2.x and was changed to a function in the 3.x. Hence, it doesn't accept parameters ergo the error.
In 2.x file and open were effectively the same thing, and in the 3.x series file was removed, which is another error.
As to your "image size not fully specified and PIL not installed" - you'll either need to look at the help for rst2ody to see if it can be specified, or install PIL (which is straightforward enough using pip or easy_install).
I'm afraid I don't have Portable Python, and although I could suggest some kludges, I'm hoping this at least gives you some pointers...