SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
People,
I'm starting to play with python and am faced with something I can not solve.
I have in my sliceware 14.2 the pycharm. Use to test codes and learn.
Now to advance in the exercises I need to do an integration with mysql.
However do not indicate in the file ppy and pycharm the following:
Import pymysql I get an error message.
I installed mysql_conector, but even that did not make a difference.
Ps: no pycharm to use: import mysql
Can someone give me a hand, or at least point me to the way forward?
If you did already install it, please provide the full output of the error within [code][/code] tags for easier reading.
In pycharm, little cod.
Code:
import pymysql
Running return:
Code:
/usr/bin/python3.5 /home/thiago/PycharmProjects/untitled2/s.py
Traceback (most recent call last):
File "/home/thiago/PycharmProjects/untitled2/s.py", line 1, in <module>
import pymysql
ImportError: No module named 'pymysql'
Process finished with exit code 1
Code:
import mysql.connector
from mysql.connector import errorcode
running cod :
Code:
/usr/bin/python3.5 /home/thiago/PycharmProjects/untitled2/s.py
Traceback (most recent call last):
File "/home/thiago/PycharmProjects/untitled2/s.py", line 1, in <module>
import mysql.connector
ImportError: No module named 'mysql.connector'
Process finished with exit code 1
In the left menu under "External libraries"> Site packages there is a directory called mysql.
But still it still gives error.
bash-4.3# pip3 install PyMySQL
Collecting PyMySQL
Downloading PyMySQL-0.7.10-py2.py3-none-any.whl (78kB)
100% |################################| 81kB 990kB/s
Installing collected packages: PyMySQL
Successfully installed PyMySQL-0.7.10
You are using pip version 7.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I wrote an import
Code:
import pymysql
and running this:
Code:
/usr/bin/python3.5 /home/thiago/PycharmProjects/untitled3/oi.py
Process finished with exit code 0
it is?
I mean, is that okay?
I'm starting, it's difficult because I do not have adequate documentation in Portuguese, so I'm forced to do the reading in English, and I'm bad in English.
I'm not terribly familiar with python. To install modules, you can do it through pip or the SlackBuild I linked to before. However, if you use pip to install python modules, the Slackware package manager won't be aware of it and it can be quite difficult to deal with if you need to remove it or if python is upgraded and needs modules rebuilt. Generally, it is better to install things so the Slackware package manager is aware of them.
However, you seem to have it installed fine now, so maybe this is more FYI for future modules.
As to your last post, exit 0 typically indicates it exited properly, meaning it should've went through and done everything it needed to and ended normally. Typically, if it errors out, it will provide an exit code of something other than 0.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.