LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-06-2018, 10:54 PM   #1
zak100
Member
 
Registered: Jul 2009
Posts: 262

Rep: Reputation: 2
windows python: how to install sympy


Hi,
I wrote the following program:
Code:
from sympy import *
a = Rational(1,2)
print (a)
I am getting following error message:

Traceback (most recent call last):
File "rational1.py", line 6, in <module>
from sympy import *
ModuleNotFoundError: No module named 'sympy'

Some body please guide me how to install sympy.

Zulfi.
 
Old 06-07-2018, 01:35 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,232

Rep: Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451
what about this: http://docs.sympy.org/latest/install.html ?
 
Old 06-08-2018, 12:03 AM   #3
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
Thanks for your help. I installed Anaconda and then gave the following command:

>conda install sympy (ran the conda from the directory where it is installed)
Solving environment: done

# All requested packages already installed.

However, my program is still getting error:

>
python rational1.py
Traceback (most recent call last):
File "rational1.py", line 6, in <module>
from sympy import *
ModuleNotFoundError: No module named 'sympy'

Some body please guide me.

Zulfi.
 
Old 06-08-2018, 12:54 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,232

Rep: Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451
in that case you may need to check where sympy.py is actually located and set the python environment accordingly.
https://stackoverflow.com/questions/...-relative-path
 
Old 06-08-2018, 01:09 AM   #5
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
I am able to use sympy through anaconda prompt see the attachment.Please guide me how to use sympy without launching anaconda prompt?

Zulfi.
Attached Thumbnails
Click image for larger version

Name:	sympy prob.jpg
Views:	186
Size:	80.6 KB
ID:	27846  
 
Old 06-08-2018, 01:16 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,232

Rep: Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451
you need to find sympy.py first
 
Old 06-08-2018, 02:26 AM   #7
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
I cant find sympy.py. I have stored the search results in an excel file. Please guide me.

Zulfi.
Attached Files
File Type: pdf search results for symp.py.pdf (64.5 KB, 82 views)
 
Old 06-08-2018, 02:32 AM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,232

Rep: Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451
try the commands: updatedb (as root) and locate sympy
if not found you may need to install it first
 
Old 06-08-2018, 08:56 AM   #9
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
Thanks for your guidance.

Windows does not have these commands (i.e.updatedb and locate). I found that windows use: dir (filename) /s instead.
C:\>dir sympy.py /s
Volume in drive C has _____.
Volume Serial Number is ----------
File Not Found


I found that the link:
https://github.com/sympy/sympy/releases

has sympy source installer. Latest has the file name: sympy-1.1.1.tar.gz. Can i install this on windows?

Some body please guide me.

Zulfi.
 
Old 06-09-2018, 04:13 AM   #10
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,232

Rep: Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451
this is described on the install documentation as well. (post #2)
 
Old 06-10-2018, 11:46 PM   #11
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 630

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
I would definitely suggest installing anaconda if you're planning on using the scientific libraries of python.
If you don't want to use much disk space you can try mini-conda

https://www.anaconda.com/
https://conda.io/miniconda.html
 
Old 06-14-2018, 09:17 AM   #12
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
I am able to install isympy instead of sympy.py. But I am getting the same error while executing the program:
python rational1.py
Traceback (most recent call last):
File "rational1.py", line 6, in <module>
from sympy import *
ModuleNotFoundError: No module named 'sympy'

I have stored the path:

echo %path%

gives me:

D:\sympy\sympy-1.1.1\bin;C:\Users\HP\.dnx\bin;
07/22/2017 03:17 AM 11,709 isympy
1 File(s) 11,709 bytes
2 Dir(s) 559,776,210,944 bytes free

Some boy please guide me how to use isympy.

Zulfi.

Last edited by zak100; 06-14-2018 at 11:55 AM.
 
Old 06-14-2018, 12:45 PM   #13
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
I am able to solve this problem from the anaconda terminal.
>python rational1.py
1/2

This means that I have to run sympy requiring programs from Anaconda terminal.

Zulfi.
 
Old 06-15-2018, 12:33 AM   #14
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,232

Rep: Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451Reputation: 5451
what I can't understand: if - using anaconda - sympy was available than sympy is there, it must be found on your PC somewhere. Why didn't you find it?

Did you try to install it from git repo?
 
Old 06-15-2018, 02:40 AM   #15
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Hi,
Thanks for your interest. God bless you.

I installed the sympy from the link you told me but it installed isympy instead of sympy.py : post# 12. I put it on the path but it never worked. Now sympy is only working from Anaconda's terminal. If i run it from any other terminal it does not work.
I am using windows 10.
Zulfi.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I got error while installing python-tk python-psycopg2 python-twisted saili kadam Linux - Newbie 1 09-05-2015 03:03 AM
Install Python 2.7.6 "python-devel" package CentOS 6.5 trava90 Linux - Software 1 01-29-2015 06:04 AM
How can I uninstall a python package installed with python setup.py install? milomak Linux - Software 1 11-16-2009 09:22 PM
Python Curses under Windows XP? introuble Programming 1 12-26-2006 07:59 AM
install python 2.3 ,necssary to remove python 2.2 ngan_yine Linux - Newbie 7 12-28-2003 04:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration