I download sympy-0.7.6. Now it is in download directory. I install python in C drive (c:\Python34).
Now how to install the sympy. There is no .exe file in sympy directory. But have a setup.py.
My OS is windows 8.
How I install or use sympy for python 3.4 in windows 8 64 bit system.???
I downloaded the sympy for perform some integration and other mathematical operations.
Please help...
thanks.
I successfully installed sympy in window 7 machine from source code.
download the zip from https://github.com/sympy/sympy
or
git clone https://github.com/sympy/sympy.git
cd sympy
python setup.py install
You have to run python setup.py install in the sympy's folder that you have download (in your download directory). Installation instructions are at https://github.com/sympy/sympy#installation
This will work with python3 as well.
But I think that you are facing problem in running python commands. You must be able to run python to install and use Sympy.
Another option is to install Anaconda, which comes with SymPy (as well as tons of other useful Python libraries and the IPython notebook). The latest version of Anaconda comes with an older version, so you'll want to open a command prompt after you install it and run
conda update sympy
to get the latest version.
Related
I am trying to run Matlab code using Python. I tried to follow the instructions given on this Mathworks page.
When trying to import Matlab though Python, it was installed using pip install matlab.
However, importing matlab.engine gives the error No module named 'matlab.engine'; 'matlab' is not a package. It cannot be installed using pip install engine either.
How can I get the code running? The Python code I'm running is as below:
import matlab.engine
eng = matlab.engine.start_matlab()
eng.triarea(nargout=0)
Python version - 3.5
Matlab version - 8.5.0.197613 (R2015a)
You need to install the Matlab Engine for Python, and it cannot be installed using pip. Try the instructions listed here. I have listed the instructions briefly below:
Make sure you have Python in your PATH.
Find the Matlab root folder. You can use the matlabroot command within Matlab to find it.
Go to the Matlab root folder in the command line.
cd "matlabroot\extern\engines\python" (In Windows)
python setup.py install
I was stuck on this for so long and I cant find a good explanation for it so here y'all go. There's a package for python called matlab here
And it has nothing to do with the matlab engine for python. When you pip install matlab it's installing this. I'm using pycharm and this is the default one it installed. I uninstalled this matlab and, instead, I copied the necessary information to my python project.
To do this, I located the folder named Matlab that is copied somewhere in AppData when you run python setup.py install in matlabroot/extern/engines/python and copied it to the lib folder in the venv of my python project since I'm using the virtual environment interpreter for pycharm.
pip install matlab gives you this, which installs a module with
from numpy import *
from pylab import *
inside. I'm quite sure this is not what you wanted...
I guess you tried importing the Matlab Compiler Runtime for Python. This has to be installed with the respective software from Mathworks though, it doesn't come through Python package index / pip. Check out the instrucions on their site.
You can visit to MATLAB official documentation: https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
I have copied here as well.
Install Python Engine for Multiple MATLAB Versions
You can specify a MATLAB version to run from a Python script by installing the MATLAB Python packages to version-specific locations. For example, suppose that you want to call either MATLAB R2019a or R2019b from a Python version 3.6 script.
From the Windows system prompt, install the R2019a package in a subfolder named matlab19aPy36:
cd "c:\Program Files\MATLAB\R2019a\extern\engines\python"
python setup.py install --prefix="c:\work\matlab19aPy36"
Install the R2019b package in a matlab19bPy36 subfolder:
cd "c:\Program Files\MATLAB\R2019b\extern\engines\python"
python setup.py install --prefix="c:\work\matlab19bPy36"
From a Linux system prompt:
cd "/usr/local/MATLAB/R2019a/bin/matlab/extern/engines/python"
python setup.py install --prefix="/local/work/matlab19aPy36"
cd "/usr/local/MATLAB/R2019b/bin/matlab/extern/engines/python"
python setup.py install --prefix="/local/work/matlab19bPy36"
From a Mac Terminal:
cd "/Applications/MATLAB_R2019a.app/extern/engines/python"
python setup.py install --prefix="/local/work/matlab19aPy36"
cd "/Applications/MATLAB_R2019b.app/extern/engines/python"
python setup.py install --prefix="/local/work/matlab19bPy36"
I too did the same. Installed matlab using
pip install matlab
and got the same error No module named 'matlab.engine'; 'matlab' is not a package.
Then I checked the official documentation for installing MATLAB Engine API for Python, and followed the installation steps from there.
For me,
pip install matlabengine
solved the issue!
I've already installed numpy 1.9.0 in Python.Now what should I do to get numpy+mkl?
If you do not have an entire Python distribution or you do not want to install one, you can download and install a compiled whl package from Christoph Gohlke's webpage. This whl contains numpy and is linked against mkl. When installing this package, you install both: numpy with the mkl dependencies.
All you have to do is:
download the correct whl file (Choose the right Python version and 32/64 file)
open a Windows cli with Windows+R and by running inside cmd
go to the directory where you have downloaded the whl file, with cd instructions
run pip install numpy‑1.XX.Y+mkl‑cp3X‑cp3Xm‑win_amd64.whl
For example, the command can be
pip install numpy‑1.11.3+mkl‑cp35‑cp35m‑win_amd64.whl
You can do it for any package with some code that has to be compiled
The easiest way is to install an entire Python distribution with lots of included packages, such as numpy and mkl. I would suggest the Anaconda Python distribution, https://www.continuum.io/downloads
The above answer does great (+1) and brought me on the right track, but to
clear things up even more:
You can download the .whl from here
For choosing the right .whl you need to know numpy‑1.11.3+mkl‑cpXX‑cpXXm‑win_amd64.whl
where the XX are actually your python version (e.g. 36 for python version 3.6.x)
Do pip install numpy‑1.11.3+mkl‑cp**XX**‑cp**XX**m‑win_amd64.whl in your cmd window and the place where you did download the .whl into
I found out that it's impossible to install NumPy/SciPy via installers on Windows 64-bit, that's only possible on 32-bit. Because I need more memory than a 32-bit installation gives me, I need the 64-bit version of everything.
I tried to install everything via Pip and most things worked. But when I came to SciPy, it complained about missing a Fortran compiler. So I installed Fortran via MinGW/MSYS. But you can't install SciPy right away after that, you need to reinstall NumPy. So I tried that, but now it doesn't work anymore via Pip nor via easy_install. Both give these errors:
There are a lot of errors about LNK2019 and LNK1120,.
I get a lot of errors in the range of C: C2065,C2054,C2085,C2143`, etc. They belong together I believe.
There is no Fortran linker found, but I have no idea how to install that, can't find anything on it.
And many more errors which are already out of the visible part of my cmd-windows...
The fatal error is about LNK1120:
build\lib.win-amd64-2.7\numpy\linalg\lapack_lite.pyd : fatal error LNK1120: 7 unresolved externals
error: Setup script exited with error: Command "C:\Users\me\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\BLAS /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /LIBPATH:build\temp.win-amd64-2.7 lapack.lib blas.lib /EXPORT:initlapack_lite build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_litemodule.obj /OUT:build\lib.win-amd64-2.7\numpy\linalg\lapack_lite.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_lite.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_lite.pyd.manifest" failed with exit status 1120
What is the correct way to install the 64-bit versions NumPy and SciPy on a 64-bit Windows machine? Did I miss anything? Do I need to specify something somewhere? There is no information for Windows on these problems that I can find, only for Linux or Mac OS X, but they don't help me as I can't use their commands.
You can install scipy and numpy using their wheels.
First install wheel package if it's already not there...
pip install wheel
Just select the package you want from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
Example: if you're running python3.5 32 bit on Windows choose scipy-0.18.1-cp35-cp35m-win_amd64.whl then it will automatically download.
Then go to the command line and change the directory to the downloads folder and install the above wheel using pip.
Example:
cd C:\Users\[user]\Downloads
pip install scipy-0.18.1-cp35-cp35m-win_amd64.whl
EDIT: The Numpy project now provides pre-compiled packages in the wheel format (package format enabling compiled code as binary in packages), so the installation is now as easy as with other packages.
Numpy (as also some other packages like Scipy, Pandas etc.) includes lot's of C-, Cython, and Fortran code that needs to be compiled properly, before you can use it. This is, btw, also the reason why these Python-packages provide such fast Linear Algebra.
To get precompiled packages for Windows, have a look at Gohlke's Unofficial Windows Binaries or use a distribution like Winpython (just works) or Anaconda (more complex) which provide an entire preconfigured environment with lots of packages from the scientific python stack.
Installing with pip
You can install the numpy and scipy wheels on Windows with pip in one step if you use the appropriate link from Gohlke's Unofficial Windows Binaries (mentioned by sebix) and run the Windows command prompt as Administrator. For example, in Python 3.5, you would simply use something like this:
# numpy-1.9.3+mkl for Python 3.5 on Win AMD64
pip3.5 install http://www.lfd.uci.edu/~gohlke/pythonlibs/xmshzit7/numpy-1.9.3+mkl-cp35-none-win_amd64.whl
# scipy-0.16.1 for Python 3.5 on Win AMD64
pip3.5 install http://www.lfd.uci.edu/~gohlke/pythonlibs/xmshzit7/scipy-0.16.1-cp35-none-win_amd64.whl
Best solution for this is to download and install VCforPython2.7 from https://www.microsoft.com/en-us/download/details.aspx?id=44266
Then try pip install numpy
Downloading the binaries for 64-bit from http://www.lfd.uci.edu/~gohlke/pythonlibs/, and installing it directly with pip in this order:
pip install numpy-1.12.0+mkl-cp36-cp36m-win64.whl
pip install scipy-0.18.1-cp36-cp36m-win64.whl
pip install matplotlib-2.0.0-cp36-cp36m-win64.whl
Note that you must place command prompt in the folder where you put the .whl files after downloading them, and you must run it as administrator,
worked for me on Windows 10 64-bit now python is up and running.
You can now pip install numpy on Windows!
"Note: this page has only historical relevance, you can now pip-install for windows"
Source: https://github.com/numpy/numpy/wiki/Whats-with-Windows-builds
Intel provides pre-compiled Python modules for free in their "Intel Distribution for Python". The modules are compiled against Intel's MKL (Math Kernel Library) and thus optimized for faster performance. The package includes NumPy, SciPy, scikit-learn, pandas, matplotlib, Numba, tbb, pyDAAL, Jupyter, and others. Find more information and the download link here
If you are on windows , you wouldn't need wheel anyway! You can directly install package by downloading the 32-bit package as win32 from this link [http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy] and then move that downloaded package to cmd's current directory and open cmd and write following codepip install numpy-1.13.1+mkl-cp36-cp36m-win32.whl then do it same for scipy
For 64-bit you need to install mingw-w64 as it is gcc and compiles numpy and scipy as precompiled status.
Currently it works fine with 32-bit.So I had opted for win32 package both for numpy+mkl and scipy in that link.
Hope This works! Give a try
You can download the needed packages from here and use pip install "Abc.whl" from the directory where you have downloaded the file.
Look into python wheels to solve your problem. The best part of python wheels is that they let you install C extensions with no compilers. I just installed numpy and scipy using pip in a clean python install and they both worked fine.
for python 3.6, the following worked for me
launch cmd.exe as administrator
pip install numpy-1.13.0+mkl-cp36-cp36m-win32
pip install scipy-0.19.1-cp36-cp36m-win32
Package version are very important.
I found some stable combination that works on my Windows10 64 bit machine:
pip install numpy-1.12.0+mkl-cp36-cp36m-win64.whl
pip install scipy-0.18.1-cp36-cp36m-win64.whl
pip install matplotlib-2.0.0-cp36-cp36m-win64.whl
Source.
Hey I had the same issue.
You can find all the packages in the link below:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn
And choose the package you need for your version of windows and python.
You have to download the file with whl extension. After that, you will copy the file into your python directory then run the following command:
py -3.6 -m pip install matplotlib-2.1.0-cp36-cp36m-win_amd64.whl
Here is an example when I wanted to install matplolib for my python 3.6 https://www.youtube.com/watch?v=MzV4N4XUvYc
and this is the video I followed.
Follow these steps:
Open CMD as administrator
Enter this command : cd..
cd..
cd Program Files\Python38\Scripts
Download the package you want and put it in Python38\Scripts folder.
pip install packagename.whl
Done
You can write your python version instead of "38"
I am very new to python so sorry if this is a trivial question. I am developing on windows and I want to install the following library pymorph
I know it can be installed on linux but how to install it on windows enviroment ?
Thanks
Download the package. Extract the package, cd to the folder (make sure setup.py is in the folder) and run python setup.py install from your cmd while in said folder.
There are 2 main ways to install a python dependency.
First method
You can install pymorph (and almost all python dependencies) with the easy_install software. You can retrieve it here.
Example :
Run the setuptools-0.6c11.win32-py2.7.exe if you are using python version 2.7.
After that, you have the easy_install executable.
To install pymorph (in a shell, using cmd.exe) :
easy_install-2.7 pymorph
Don't forget to adapt the name of the easy_install executable with the good python version.
The advantage of this method is that it uses the Python Package Index :
According to Wikipedia :
The Python Package Index or PyPI is the official third-party software repository for the Python programming language. Python developers intend of it to be a comprehensive catalog of all open source Python packages.1 It is analogous to CPAN, the repository for Perl. Package managers such as EasyInstall, pip and PyPM use PyPI as the default source for packages and their dependencies.
Second method
In a shell, using the cmd.exe, go to the pymorph folder. After that, always in your shell :
python setup.py install
In a same way, python executable name can depend of the version of python. Example :
python2.7 for python version 2.7
from this site
http://matplotlib.sourceforge.net/users/installing.html#installing-from-source
tell us that the requirement is python 2.4 or later but not python3.
Now im working with python3 and i need some plot form matplotlib.
So how to solve it?
I'm sorry, but at the current time it's not supported.
If you feel brave, you can try with the Py3k SVN branch which reportedly works with a simple example. Be aware that there has been no update in the last 8 months on this though.
Of course, you'd be more than welcome to contribute to the porting to Python 3 if you could.
You could try the unofficial versions. Check this site:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Looking at the docs at the link it says the following is a dependency:
Python (>= 2.7 or >= 3.4)
You can download a version of Python that will work at:
https://www.python.org/downloads/windows/
I would go with the most recent release and a 64 bit version as certain libraries for data analysis do not run on the 32 bit version of Python.
The version of Python you download will come with pip which you can then use to install any libraries you need to do your work.
Make sure you have set your environment variables if you want to run your programs from the command line or bash terminal.
I installed matplotlib through the bash terminal with:
pip install matplotlib
Let me know if that helps.
To install matplotlib on windows, first, you have to install pip first to install pip on windows go to website
https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip
Download get-pip.py, being careful to save it as a .py file rather than .txt. Then, run it from the command prompt:
python get-pip.py
if pip is already installed, install matplotlib by writing in command prompt:
python -mpip install -U pip
python -mpip install -U matplotlib