I installed Python 3.11 today (02/13/23). When I call python (by typing py), it returns the error - "could not find platform independent libraries - encoding

It is my first time trying Python. On the command prompt, I typed py and I got a long error message which started by
Could not find platform independent libraries
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)...
.
.
.
.
.
.
and on and on (it is a long message). Any idea what's wrong with my program?
Tom.
I wanted to open IDLE so as to do some practice but the interface wasn't loading.

Related

Creating module with pybind11 and debugging it in python at runtime crash

I'm re-posting my issue from https://github.com/pybind/pybind11/discussions/4477 to here as I'm not getting much luck there for now...
To summarize I have c++ application that has python in it via boost. I want to load a c++ dll in to it via pybind11 and debug my dlls at runtime via attaching myself to the process and breakpoints in the source.
Sadly when I hit breakpoint I get that crazy error that you can see there.
I think this is the relevant part >
00007FFAE47AEAA5 (ucrtbased): (filename not available): get_wide_winmain_command_line
00007FFAE47AE8C3 (ucrtbased): (filename not available): get_wide_winmain_command_line
00007FFAE47B158F (ucrtbased): (filename not available): wassert
00007FFACC14B3F0 (python37_d): (filename not available): PyAST_Validate
S:\vcpkg\installed\x64-windows\include\pybind11\detail\internals.h (414): `pybind11::detail::get_internals'::`2'::gil_scoped_acquire_local::gil_scoped_acquire_local
S:\vcpkg\installed\x64-windows\include\pybind11\detail\internals.h (417): pybind11::detail::get_internals
S:\RnD\DLL_python\c_DLL_Python_01\icLib\library.cpp (34): PyInit_mydll
I've tried setting up compiler flags/etc but sadly no luck.
Has any1 been able to compile pybind11 to pyd dll on windows & load it in python and then breakpoint into it?
To any1 wondering why I'm jumping over soo many hoops and not using python... I wrote a framework in c++ that works between 4 apps via c++ api, sadly 5th app is only python and thus I "can" use my framework via pybind11 but I need help debugging.

How to resolve Pymongo Runtime Error R6034 in Houdini

I'm working at a visual effects studio in which we use MongoDB/pymongo for our asset management. Our studio is using the SideFX software Houdini.
So far MongoDB has been a pleasure to work with in terms of programming, however whenever we connect to the MongoDB via pymongo from within Houdini, we're getting the following error:
Microsoft Visual C++ Runtime Library - Runtime Error!
Program: C:\houdini\17.5.293\bin\houdini.exe
R6034
An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information.
This error occurs everytime when we import pymongo for the very first time, i.e. in a Python shell within Houdini, which is using Python 2.7. Once we click 'OK' on the error popup (it appears twice after clicking OK for the first time), the error disappears and we're able to connect successfully to the database.
The SideFX support team suggested that pymongo wasn't compiled with Visual Studio 2017, which is the compiler SideFX is using for their software.
Now we've been trying to debug this for a while now to no avail. Here's a rundown of what we tried:
update Windows10 to the latest and greatest
updating pymongo from 3.5.1 to 3.9.0
launching Houdini from different builds (16.5, 17.0, 17.5), we get the error in every version.(We're launching a vanilla Houdini session without any 'PYTHONPATH' or 'PATH' environment variables set)
interestingly enough my colleague imported pymongo into Houdini successfully on his private laptop last night without any errors occurring which leads me to believe that the error might be related to our system settings possibly?
I would love to find out how to get rid of this error message because it is really messing with our current pipeline. Any suggestions/help is welcome and much appreciated.
Please let me know if you need any additional information in order to debug this matter.
Thanks a lot in advance,
Manu
This post here helped me to resolve my issue:
Runtime error R6034 in embedded Python application
What happened is that we have a Python 2.7 install located at C:\Python27 which is being added as an environment variable 'path' in Windows.
Using the Process Explorer, I learned that this folder contains the file 'msvcr90.dll' which is conflicting with Houdini, since Houdini comes with its own Python installation that doesn't contain this dll file.
The solution is simple. When launching Houdini in a custom environment, strip the C:\Python27 from the 'path' environment variable so Houdini only fires up its own Python interpreter.

Getting Error : There is no simulation script. Please check that your scripts are in user-files/ simulations Press any key to continue . .

I am facing this problem, when executing gatling batch file using command prompt.
GATLING_HOME is set to "G:\gatling-charts-highcharts-bundle-2.1.4"
There is no simulation script. Please check that your scripts are in user-files/
simulations
Press any key to continue . . .
I have downloaded new Gatling copy gatling-charts-highcharts-bundle-2.1.4 from http://gatling.io/download/
And trying to run computerdatabase Simulation, getting error message.
Is there any way to run simulation other than using batch file through Command prompt?
Thanks
You can run it with
The sbt plugin
The maven plugin
As standalone application. You find an example in the Maven archetype
Run with Jenkins and the Gatling-Jenkins plugin
Note that the above documentation links use the Gatling version 2.1.7. Yet the plugins exist as well in older versions (like 2.1.4) and will probably continue in later versions as well - just replace the version number on http://gatling.io/docs/2.1.7/.
The cause may be the lack of JAVA_HOME environment variable.

How to get MayaVi2 to default to/use Qt rather than wx?

Previously I have been using a python environment maintained by Mac ports. I had some basic scripts using PyQT, VTK, matplotlib etc. I have been able to use Paraview but seem a little heavy for my uses so I though I would try MayaVi2 (and TVTK).
I downloaded and tried to manually installing but it proved troublesome. So thought I would bite the bullet and try Canopy (academic License). Based on this VTK/Mayavi on Mac OS X which suggests all is good in the world of Qt, VTK and MayaVI, I installed 64 bit Canopy.
I am having trouble getting mayavi2 to work within the Canopy environment. It runs, but the console gets lots of errors, if I call up any dialog/setting box the "buttons" don't work properly. Here is the first error (of a couple of screen fulls) when I try to start mayavi2:
(Canopy 64bit) scratch_pad 501 $mayavi2 Traceback (most recent call
last): File
"/Applications/Canopy.app/appdata/canopy-1.0.0.1160.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/pyface/ui/wx/splash_screen.py",
line 121, in _on_paint
dc = wx.PaintDC(window)
I am actually more interested in TVTK, so I tried some of the mayavi demos from the website gallery http://docs.enthought.com/mayavi/mayavi/auto/examples.html The few I tried kind-a worked, that is they display a VTK (?) window/scene, I can interact with the VTK window. All is good until I open a settings/dialogue window, and then none of dialogue window "button" work and i have to force quit. Here is the last line of error when I open the "Setting" button in the plot3D demo:
simple demo: File
"/Users/michael/Library/Enthought/Canopy_64bit/System/lib/python2.7/site-packages/wx/_core.py",
line 9162, in DestroyChildren
return core.Window_DestroyChildren(*args, **kwargs) wx._core.PyAssertionError: C++ assertion "GetEventHandler() == this"
failed at /BUILD/wxPython-src-2.9.2.4/src/common/wincmn.cpp(468) in
~wxWindowBase(): any pushed event handlers must have been removed
I even tried
ipython --gui=wx
(as suggested on the page) but in this case it crashes, no window.
Based on the error messages on the console they all appear to be wx related. It is my understanding the the Canopy environment is "self-contained", but could my old environment be somehow conflicting? How would I even test this?
Is there a way, environment variable, that mayavi2 can use Qt instead of wx? I don't use wx in any of my local python scripts, so unless it is needed in Canopy I am quite happy to disable, if that is an option.
Any ideas?
After running most of the examples in the Mayavi Gallery I have discovered that I needed to inform Traits to use Qt. This was done by setting an environment variable from within the script using a sys.environment() call. I decided to set the environment variable ETS_TOOLKIT to qt4 in my .profile as follows:**
export ETS_TOOLKIT=qt4
Mayavi2 now works as advertised!

Error with zend installation on win 7

I am trying to install ZEND FRAMEWORK on my localhost but failing miserable. I am following the below mentioned steps but don't know where am I going wrong. Please help me with the same.
Steps are as follows that I followed:
Downloaded the ZEND Framework full package version 1.11.7 which is about 25 Mb in a zipped version and then unzipped it to a folder called ZendFrameWork.
Copied the ZendFramework folder inside my c:\xampp\php\
changed the "include_path = '.;\xampp\php\PEAR;\.;C:\xampp\php\ZendFramework\library' " in the php.ini file.
Then restarted the apache server.
EDIT :: I have successfully managed to get the zf command to run without any errors. but now, all it does is, after i enter "zf create myproject" it just gets stuck with the cursor blinking on the next line. And if i press CTRL+C, i get the message : Terminate batch job ? (Y/N)
Then set the environment variable for zf.bat file as " C:\xampp\php\ZendFramework\bin "
But when I try to execute the " zf create sampleProjName " from command line it does nothing, so then I used Windows Powershell and it gives the error which I have attached below.
Waiting for your response.
Thanks in advance.
Try using normal cmd - not powershell. Works fine for me.
Thanks for all your response.
I successfully installed Zend Framework.
I removed the full installation and replaced it with minimal installation and also I did not have php.exe set as an environment variable, so i did that too and also in the php.ini file i needed to write the zend library first before the pear one.
And this was it, TA-DA, it worked.
:)