I have searched around entire internet.
1. i have 64bit 2014 maya installed, i had 32bit python installed at c:\python27.. as you know maya installs its own python and works with that, i want to change it and make maya work with my own python that is installed in c drive.
What i did?
1. i did change the python, first unisntalled and and then installed 64bit version, i copied cv2.pyd to its site-packages and also installed matplotlib,scipy, pandas, numpy. my code in pycharm works just fine but maya gives error.
2. i changed mayas python path environment but still maya is using its own installed python not pointing to mine.
import sys
print sys.platform
print sys.version
print sys.prefix
print sys.path
in maya tells me that its using python 2.7.3 whereas the python i want to point which is in c drive is 2.7.8.. anything ? how can i make maya work with the other python
Maya's version of Python (mayapy) is compiled with Visual Studio 2010, Python's 2.7.x standard distribution is compiled with VS2008, and the two aren't compatible. So packages you install via pip in your standard 64 bit Python install won't work with Maya if they have binary dependencies. (ex numpy, scipy, PIL, pandas, etc...)
To test, open a python tab in the script editor and do this:
import sys
print (sys.version)
# Result: 2.7.3 (default, Aug 1 2012, 16:33:56) [MSC v.1600 64 bit (AMD64)] #
The part that matters here is in square brackets [MSC v.1600 64 bit (AMD64)].
If you do the same in your installed version of Python 2.7.x, you'll see that they won't match.
What you'll need to do is to compile these modules yourself using Visual Studio 2010 + either mayapy or a version of Python specifically built with VS2010. Either way it won't be easy in some cases.
I've made builds of packages I use compatible with Maya 2014-2015-2016 available here. Extract those packages anywhere Maya can see python packages and you should be able to work.
Side note: Maya on OSX doesn't suffer from these compatibility issues.
Related
Working on python 2.7(not anaconda). Operating system Windows server 2012 R2
The pypi installation mentions two fixes for this, installing Visual C++ redistributable 2015 and Universal C Runtime.
As well as a manual fix for older anaconda versions, which is for python3(I am not using anaconda version, and also my python version is 2.7 so presuming it doesn't apply in my case)
link here:
https://pypi.org/project/opencv-python/
installed both the dependencies but couldn't get it to work.
Any ideas on how I may fix this?
Since Python 2.7 is still supported, this could be the possible solution.
Installing OpenCV from prebuilt binaries:
Below Python packages are to be downloaded and installed to their default locations.
Python-2.7.x
Numpy
Matplotlib
Install all packages into their default locations. Python will be installed to C:/Python27/.
After installation, open Python IDLE. Enter import numpy and make sure Numpy is working fine.
Download latest OpenCV release and install it : Latest OpenCV-build
Goto opencv/build/python/2.7 folder.
Copy cv2.pyd to C:/Python27/lib/site-packeges.
Open Python IDLE and type following codes in Python terminal.
import cv2
print cv2.__version__
How to check if the installed wxPython in my machine is 32-bit or 64-bit?
Here's a simple way:
Run Python in a your terminal. On Windows, Python will usually mention 32-bit or 64-bit in the interpreter.
import wx to make sure wxPython is installed for this version of Python.
Now that we know you have wxPython installed for this version of Python, you can use Python's platform module to find out which version of Python you're using
Here's the code:
import platform
print(platform.architecture()[0])
You cannot install 64-bit wxPython with 32-bit Python (or vice-versa). So this should work fine.
Solution:-
Step 1:-
Open cmd
Step 2:-
Type pip show wxpython-phoenix
That's it. It it shows your version of wxpython, then obviously your system is installed with it. Else install it by using the following command
pip install wxpython-phoenix
Done.
I wrote some python code on my mac and how I have to transfer it over to a windows computer. This is frustrating beyond words. I installed Python 2.7 x32, then I uninstalled it, then I installed Python 2.7 x64. My python script depends on xlrd and xlwt, and some other downloaded modules. I would like to install those using easy_install or pip or any way that is easy for somebody who doesn't know too much about the really intricate workings of a computer. As of now, if I do this:
C:\Windows\System32> python
I get:
'python' is not recognized as an internal or external command operable program or batch file.
Would someone suggest a next move for me?
I did a bunch of google-ing and stackoverflow-ing and seem to have landed here, I'm not sure how to download something from here. For example, how would I download Pip, and also, which one would I download?
People say that a person should download and install this, how would I do that?
I'm familiar with terminal, what would I type into cmd?
The reason that I things were not going well for me was because I was using a mixture of Python 2.7 (32-bit) and Python 2.7 (64-bit). After more researching I found that even though my Windows 7 was 64 bit, I didn't have to download the 64-bit python. In fact, the 32-bit python was more compatible with other programs. So I clicked around and uninstalled python and everything else that had the name 'Python' in it from my Add/Remove programs menu. This took about 10 minutes. Next, I downloaded the 32-bit Python 2.7. After this, all of the packages that I download, I made sure that they were 32-bit and not 64-bit.
Also, very important, I went to my 'Environment Variables' (google how to get there) and added the directory of where Python27 was installed. To do this you can follow this guide. The last thing that I did was add ;.PY to the end of PATHEXT.
Another of my queries about an embedded Python 2.7.3 interpreter on Windows. I need to install numpy and matplotlib as support packages for an embedded interpreter in a C++ program compiled in Visual Studio 2010.
Some background:
I've been trying to make this work for a few months. The main issue is that numpy for Python 2.7 is compiled against an earlier version of the MS C library (VS2008) whereas my application is compiled against the 2010 version (a fact beyond my control - that is the office compiler).
I worked around this by fiddling with the manifest for my application to let it load the correct C library for numpy and this got it to import. As an end-user has tried out new features, bugs have started to appear, including untraceable crashes.
My current state:
I pinned some of these down to a poor compilation on my part of the Python 2.7.3 source, in particular the dependencies (lots of the crashes seemed associated with Tkinter from matplotlib). So I started afresh on the Python compilation and now have a clean compiled version of all the core and dependencies of Python 2.7.3. Now I'm looking at numpy/matplotlib.
My questions
Is it worth attempting to compile numpy against VS2010 or is my earlier manifest mangling solution the only way?
If the former, what problems might I encounter in doing so (i.e. what should I watch ou for)?
In the latter, how do I get numpy to install in the lib/site-packages folder of my embedded intepreter?
use cygwin to build numpy on windows.
I am on windows-xp
Its working fine for me.. .!
In cygwin python2.6 comes as a default python. I have installed python2.7 but not installed numpy in python2.7.
To use it on python2.7 i have run python2.7 setup.py build
You can see that in screen-shot of my terminal. and in folder 'namit' i have placed 'numpy' dir that i have compiled on cygwin.
when i have imported numpy when i am in that dir.. it worked...you can see that in globals() from where it has imported.
I am trying to install PythonMagick. I am using Python 2.7 and running Windows 7. I have tried following the directions in the readme, but all of the configuration scripts are of type "file" and cannot be executed in either the python or windows command line. What should I do?
I recommend you use the pre-compiled installer from the Unofficial Windows Binaries for Python Extension Packages.
Just follow this link and download the right installer for your Python interpreter (in your case it will either be PythonMagick-0.9.10.win-amd64-py2.7.exe or PythonMagick-0.9.10.win32-py2.7.exe, depending on whether you've installed the 64 or 32 bit Python interpreter).