How to install omniORB and omniORBpy on Windows 10? - python

Context
I need to install omniORB and omniORBpy on Windows 10 to use Python 3.7 as Server Skeleton and a Java Stub as client.
I have already installed omniORB and omniORBpy in Ubuntu LTS 18.04 and I have a small system made. It works perfectly, but it is only compatible with Python 2.7 and I need it to be Python 3.7.
This is what the system I did looks like (it's in Spanish, sorry for that)
What I have tried
First, I tried copying the omniORBpy files (omniORB, CORBA.py, etc) from my Python 2.7 Ubuntu venv to the venv of my Python 2.7 in Windows. Just to try.
PyCharm recognizes the venv libraries but when I run the script, it says that I can not find the file "_omnipy" (and I guess other files that it still does not tell me). I realized that this library used * .so files (obviously) and that I needed it maybe it was a type of * .dll to work with Windows.
This is my Python 2.7 venv (site-packages)
This is the error what I get on PyCharm
On the other hand, I still can not find how to install omniORB to use the omniNames service and have the IOR (on Windows) and use omniidl to "compile" my idl file.
I need something like
sudo omniNames -start 2809
on Windows cmd (not on a subsystem of Linux installed on Windows).

Firstly, I recommend you search Stack Overflow before posting; you'll often find that someone has answered your question previously.
Secondly, I recommend you read the included readme file from omniORB 4.2.0. There are installation instructions for Win32 and Win64 platforms.
Lastly, refer to this Stack Overflow thread, it may offer additional help.

Related

Virtual box python different python version

I'm newbie of python programming.
I have windows 7 laptop and I'm also running virtual box Ubuntu.
I manually installed python3.5 on Win7 through Eclipse first. The default python version in my Virtualbox Ubuntu is 2.7.11.
Is it possible for me to install python packages through my VirtualBox to my Win7 python3.5?
Will it bring any problem with multiple versions of python.
python 3.5 packages do not work with python 2.7 and vice versa.
And I even think that you can't install packages from linux to windows.
I think what you wish to accomplish is to have a same version Python across both machine.
Best way is to go about doing it is to either install Python 2.7.x on Windows 7 or upgrade python 2.7.x on your Ubuntu to Python 3.5.x. Neither is good or bad.
To upgrade your Python 2.7.x to 3.x.x on your ubuntu machine,follow the instructions here.
If you wish to wish to install Python 2.7.x on your Windows,simply download the compatible exe from official page .It will create a folder under c: e.g. C:\Python27 .Thereafter,add the python path to environment variable PATH.
As for installing packages,the command remains the same across both OS.
pip install <package-name>
Usually packages have dedicated versions for different python versions.pip install will automatically resolve versions and install the compatible package version.
The Ubuntu VirtualBox is not just a linux-looking frontend to your existing Win7 install. It's a completely separate OS that runs as if it were on a separate computer. You can set up shared folders to share data between the host and guest, but trying to use Linux to install programs on Windows would be error-prone and risky even if you could do it.
If you plan to be using Python on Windows, you'll need to install the packages on Windows, and a Linux VirtualBox isn't going to help you with that at all. If you're uncomfortable with the Windows command line, read up on some tutorials. There are also some alternative Windows shells that provide some advantages over the built-in CMD.
If you'd rather work on Linux, you can do that, but you'd want to do it entirely inside the VirtualBox. Inside Linux, you could install the version of Python you want, install the packages you want, and use whatever dev tools you want, as if you were working on a Linux computer. (Although in this case I have to wonder why you aren't actually using a Linux computer instead of a Windows one.)

Cannot Open Python. Error 0xc000007b

I have recently been learning Python 3. I have had no problems on my netbook (32bit Windows 7) I with creating small simple programs. When I installed it on my netbook I had no problems, but now that I've been getting into it I want to install it on my desktop and I have one.
My desktop is a 64 bit OS running Windows 7. Like I did with my netbook, I went to download Python and install the 64 bit edition.
After installing it, I went to open up Python CLI and GUI and no luck. It gave me this error.
"The application was unable to start correctly (0xc000007b). Click OK to close the application"
I also tried reinstalling, but not luck.
I suspect a missing .dll but I am not completely sure. Does anyone know what is keeping me from opening Python and how do I fix it?. I want to resume my work as soon as possible.
That is the NTSTATUS error code for STATUS_INVALID_IMAGE_FORMAT. Almost invariably that means that the loaded is attempting to link a 32 bit DLL into a 64 bit process, or vice versa.
If you want to attempt to debug this then the tool of choice is Dependency Walker. You open the python.exe executable file in Dependency Walker and use the profile menu to start it up with logging of the load events. Somewhere along the way there will be a failure and you'll be able to see which module is causing that failure. That will hopefully point the way towards a resolution.
However, attempting to debug this may be a waste of time. It will probably better to uninstall the existing installation, and try to re-install. Perhaps picking a different Python distribution.
I note that you have selected a 64 bit version. Now, support for 64 bit extension modules is not as strong on 64 bit Python as on 32 bit Python. It does exist, but they modules can be harder to come by and install. You might consider installing a 32 bit Python next time round.
Please make sure that Python3.dll is the same version and the same architecture (32/64) with python.exe. I fixed this error via replacing it with 32bit version.
you should delete the old path of python in "Environment Variables" and enjoy ;)
As janne-karila mentioned, and for Python 3.5, Microsoft Visual Studio 2015 redistributable (in this case the 64 bit version)
This probably won't answer your question, but my answer is for a very specific case when you "Refresh Windows without affecting Files" to fix your Windows 8.1 PC.
If you do that, You'd get this error when you try to run Python after the windows refresh.
To fix this error, simply re-install PY at the same folder where your python was install before you refreshed windows. If you try to install it any other folder like username/appdata/... folder the PY installer would be stuck in initialization.
You may also get another error saying "api-ms-win-crt-runtime-l1-1-0.dll is missing". To fix, go to the windows.old folder and get the dll file ith the above name and paste it in the PY folder. Also like others have suggested, make sure Microsoft Visual Studio 2015 redistributable is installed.
Encountering this error after a windows refresh is so rare, that no one else seemed to have experienced according to google searches, so I though I share it here for that rare unlucky person.
Apparently the error code stands for STATUS_INVALID_IMAGE_FORMAT (source), and it looks like it's not specific to Python. You can try reinstalling the program, rebooting, running CHKDSK /r (source). It might also have something to do with the Microsoft Visual C++ redistributable package, as Janne Karila and this thread suggest.
This stackoverflow question also looks like it has some useful information.
I too faced this problem. So I uninstalled python3 64-bit version and installed 32-bit version, after that i am able to launch python3 in windows 8 successfully. (i have a 64-bit laptop).
Simply, download the last version of Microsoft Visual C++ redistributable package ..
I had the same problem ..
I have the same error found. Using dependency walker, I found tons of DLLs missing. Rather going for copying all the DLLs I went with virtual environment. It will create another environment for Python.
First, install python normally. Copy, the Python.exe path. In my case, it is
C:\Python\python
It will be used to install Python libraries. Then, using command prompt, I used pip to download and install virtualenv (Virtual environment). To do that, change the directory to where pip.exe is, which is in Scripts folder. Now, run the following to install virtualenv:
C:\Python\python pip install virtualenv
It will install Virtual environment.
Now, create a folder to hold virtual environment and change directory to that folder and run to create the following to create an environment:
virtualenv --no-site-packages [environment name]
It will create the Environment.
Now, change subdirectory to Scripts in the [environment name] folder. There is a activate file run it, in my case it is like:
C:\Python\virtualenv\env\Scripts activate
env is the [environment name] here.
If you activate it, every command will look like:
(env) C:\Python\python
This ends here. Now, you can install any python library using this. Do whatever, you want using Python.
Also, to deactivate the environment same deactivate.bat is in the scripts folder.
For me the issue was, I had installed 32 bit version on a 64 bit machine. Hope it helps someone out there.
Like many have said, Windows cannot load python.exe itself or one of its dependent DLLs because of INVALID_IMAGE_FORMAT:
python.exe is of unsupported bitness. 32bit on 64bit Windows is supported. 64bit on 32bit system is not (solution: install 32bit python, bye).
python.exe or one of its DLLs is corrupted (probably not)
one of the dependent DLLs is not of the same bitness as the EXE:
python.exe (say, 32bit) requires python*.dll (python3.dll or python27.dll). It installs that into Windows System32/SysWOW64 folder. The DLL is of correct bitness (32bit).
Something else overwrites that with 64-bit version, or places a 64-bit version somewhere in the search PATH.
When you run python.exe (32bit), Windows searches for python*.dll, and the first one it founds is the 64bit one. 32bit EXEs cannot normally load 64bit DLLs.
Typical examples:
TortoiseHg installs its own copy of python (both .exe and .dll) into its own folder and adds itself to PATH. The bitness can be different (say, 64bit) and usually matches platform bitness.
Another installation of Python with a different bitness somewhere else overwrites the DLL (it shouldn't, they have different System32s, but who knows)
Diagnostics:
Dependency Walker marks 64bit DLLs with 64bit icons. Verify that icons for python.exe and python*.dll match. Right click -> "Show full paths" to see where the DLL is taken from.
Simple solutions:
Maybe you have another, functioning copy of Python somewhere else? Check it.
Reinstall Python, preferably in the platform version (64bit for 64bit OS, 32bit for 32bit) Yeah, that's what many are saying, but now you know why this is needed.
Remove offenders from PATH. While this maaaay fix your Python, this will break the offenders and some (TortoiseHg explorer plugins) need the PATH. So maybe compromise with them and choose #2.
In my case I was installing both the 32 and 64 bit versions of the python msi. They both install to the same folder, c:\python32. I thought msi's would prevent those kinds of conflicts, but no.

Pyscripter on Cygwin

Question: How to install Pyscripter on Cygwin?
Scenerio: I have installed portable apps on a usb, then installed cygwin portable version 0.9 on it. Under cygwin, I have installed Python 2.6. I am curerntly using it with the idle IDE but I would like to use Pyscripter instead.
I can not use portable python because I need to install additional modules on python such as pyevolve and Cantera. Alternatively, maybe someone could let me know how to add these modules to portable python.
You can create virtualenv in your usb. And just switch it on in any other computer via Cygwin from our usb. It is not a way to install Pyscripter. But it is way for add modules to your portable version of python.
For anyone else trying this, note that PyScripter is intended to run under Windows, not Linux. The steps are: (1) in Windows, install a python distribution from python.org, and (2) in Windows, install PyScripter.
Note, too, that PyScripter has the desired console (interactive python interpreter) window, and a pip-based package manager that allows adding packages. For example, to add Pandas to an app, do the following:
menu: Tools menu
submenu: Tools
menu item: Install packages with pip
Package Name: pandas
The correct pandas package with required dependencies will be installed. (At least, that is what happened in my case). I was then able to import pandas into my app and use it without any problem.
Cygwin is a Linux environment that installs/runs under Windows. One of its main claims to fame is that it allows you to use Linux commands at the Windows CMD prompt. It also allows you to install/run certain Linux apps, which you then run in the Cygwin (and/or Cygwin-X graphical) environment. For example, it is possible to install/run Eric6 (a graphical Linux python IDE) under Cygwin. (I tried that, it worked - but not as great as Pyscripter)
For my money, I found that Pyscripter under Windows works great - and is much, much nicer than Eric6 under Cygwin. I am a Notepad++ user for HTML/js/PHP and started out using Anaconda (Spyder) to code in Python. PyScripter is much closer to NPP than, for e.g., Spyder or IDLE or Eric6 - and is more like what I had hoped to find in the Python world - and it simply runs under Windows like any other Windows app.
References:
https://sourceforge.net/projects/pyscripter
https://github.com/pyscripter/pyscripter

Opencv 2.2 not recognized on Python 2.7 (Ubuntu/Windows XP)

I've been trying to connect opencv and python in both Ubuntu and Windows XP. I've failed on both.
I've read many webpages and threads about "how to install" it but none has worked (the worst part is that they all say kind of the same).
Steps (windows xp):
Installed Python 2.7 by default (works perfectly)
Installed PIL and cx_Freeze (may they
create a conflict? I don't think so
:s)
Installed Opencv 2.2 by default
(OpenCV-2.2.0-win32-vs2010.exe) and
it isn't recognized inside a py nor
as import opencv.cv nor using the
cookbook way, import cv (I skipped
the visual studio steps since I'll
use it with python)
Checked path (it's ok, it has the
Opencv2.2\bin thing)
Rechecked webpages and stuff
Steps (ubuntu):
Had python working
sudo apt-get install, cmake, make,
sudo make install, etcetc (from the
tutorials)
same thing... module not recognized
Please can you help?
Update:
I managed to install it and have it recognized by the system (I used http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv and it worked perfectly after that).
The problem now is that it crashes when I try to use CaptureFromFile. Someone else has reported it 3 days ago so now I wait.
I'll check the other wrappers, maybe one of them will work.
For windows see my web page: http://www.modernmind.org/wiki/OpenCV
For Ubuntu you should just need to apt-get install python-dev then generate the make files with Cmake, build it and then make install. In order to build the python bindings you need to have the python header files on your system and you probably don't. When you run configure in Cmake make sure that you don't see any messages at the top about PYTHON_INCLUDE not being defined.
To access a library it needs a Python library installed in the Python version you are using. From what you write above it seems to me that you install OpenCV in general, but that you don't specifically install the Python library. This is why it doesn't work.
I'm not sure how to install the Python wrappers, and the OpenCV documentation is a bit sparse on that info. But if you did build them (and that needs to be turned on explicitly, says the docs) they seem to end up in opencv/release/lib .
Look at "Testing Python wrappers" on http://opencv.willowgarage.com/wiki/InstallGuide
If there is still no luck, there is a bunch of alternative Python wrappers available: http://pypi.python.org/pypi?%3Aaction=search&term=opencv&submit=search
Maybe they are better documented.

Installing SetupTools on 64-bit Windows

I'm running Python 2.7 on Windows 7 64-bit, and when I run the installer for setuptools it tells me that Python 2.7 is not installed. The specific error message is:
`Python Version 2.7 required which was not found in the registry`
My installed version of Python is:
`Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32`
I'm looking at the setuptools site and it doesn't mention any installers for 64-bit Windows. Have I missed something or do I have to install this from source?
Problem: you have 64-bit Python, and a 32-bit installer. This will cause problems for extension modules.
The reasons why the installer doesn't finds Python is the transparent 32-bit emulation from Windows 7. 64-bit and 32-bit programs will write to different parts of the Windows registry.
64-bit: HKLM|HKCU\SOFTWARE\
32-bit: HKLM|HKCU\SOFTWARE\wow6432node\.
This means that the 64-bit Python installer writes to HKLM\SOFTWARE\Python, but the 32-bit setuptools installer looks at HKLM\SOFTWARE\wow6432node\Python (this is handled by windows automatically, programs don't notice). This is expected behavior and not a bug.
Usually, you have these choices:
the "clean" way: use 32-bit Python if you have to use 32-bit modules or extensions
the other "clean" way: only use 64-bit installers when using 64-bit Python (see below)
what the answer above suggests: copy HKLM\SOFTWARE\Python to HKLM\SOFTWARE\wow6432node\Python, but this will cause problems with binary distributions, as 64-bit Python can't load 32-bit compiled modules (do NOT do this!)
install pure Python modules with setuptools instead of the distutils installer (easy_install or pip)
For setuptools itself, for example, you can't use a 32-bit installer for 64-bit Python as it includes binary files. But there's a 64-bit installer at http://www.lfd.uci.edu/~gohlke/pythonlibs/ (has many installers for other modules too). Nowadays, many packages on PyPi have binary distributions, so you can install them via pip.
Apparently (having faced related 64- and 32-bit issues on OS X) there is a bug in the Windows installer. I stumbled across this workaround, which might help - basically, you create your own registry value HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.6\InstallPath and copy over the InstallPath value from HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\InstallPath. See the answer below for more details.
If you do this, beware that setuptools may only install 32-bit libraries.
NOTE: the responses below offer more detail, so please read them too.
I made a registry (.reg) file that will automatically change the registry for you. It works if it's installed in "C:\Python27":
Download 32-bit version HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER\SOFTWARE\wow6432node\
Download 64-bit version HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER\SOFTWARE\
Yes, you are correct, the issue is with 64-bit Python and 32-bit installer for setuptools.
The best way to get 64-bit setuptools installed on Windows is to download ez_setup.py to C:\Python27\Scripts and run it. It will download appropriate 64-bit .egg file for setuptools and install it for you.
Source: http://pypi.python.org/pypi/setuptools
P.S. I'd recommend against using 3rd party 64-bit .exe setuptools installers or manipulating registry
Create a file named python2.7.reg (registry file) and put this content into it:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\Help]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\Help\MainPythonDocumentation]
#="C:\\Python27\\Doc\\python26.chm"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath]
#="C:\\Python27\\"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath\InstallGroup]
#="Python 2.7"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\Modules]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\PythonPath]
#="C:\\Python27\\Lib;C:\\Python27\\DLLs;C:\\Python27\\Lib\\lib-tk"
And make sure every path is right!
Then run (merge) it and done :)
Get the file register.py from this gist. Save it on your C drive or D drive, go to CMD to run it with:
'python register.py'
Then you will be able to install it.
For 64-bit Python on Windows download ez_setup.py and run it; it will download the appropriate .egg file and install it for you.
At the time of writing the .exe installer does not support 64-bit versions of Python for Windows, due to a distutils installer compatibility issue.
To allow Windows installers to find the installed Python directory in Windows 7, OR, change which Python installation to install an installer into, add the installed path into the InstallPath registry key's (Default) value:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.X\InstallPath
Where "X" is the Python version (that is, 2.5, 2.6, or 2.7).
I tried the above and adding the registry keys to the LOCALMACHINE was not getting the job done. So in case you are still stuck , try this.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Python]
[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore]
[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7]
[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\Help]
[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\Help\Main Python Documentation]
#="C:\Python27\Doc\python272.chm"
[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\InstallPath]
#="C:\Python27\"
[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\InstallPath\InstallGroup]
#="Python 2.7"
[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\Modules]
[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\PythonPath]
#="C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk"
Copy paste the above in notepad and save it as Python27.reg . Now run/merge the file as mentioned in the answers above. (Make sure the paths of Python installation are corrected as per your installation.
It simply does ,what the above answers suggest for a local machine ,to the current user.
Here is a link to another post/thread. I was able run this script to automate registration of Python 2.7. (Make sure to run it from the Python 2.x .exe you want to register!)
To register Python 3.x I had to modify the print syntax and import winreg (instead of _winreg), then run the Python 3 .exe.
https://stackoverflow.com/a/29633714/3568893
You can find 64bit installers for a lot of libs here: http://www.lfd.uci.edu/~gohlke/pythonlibs/

Categories