LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-04-2017, 07:11 PM   #1
thiagofw
Member
 
Registered: Jul 2016
Location: Minas Gerais, Brazil
Distribution: Slackware 14.2
Posts: 42

Rep: Reputation: Disabled
Unhappy Slackware 14.2 + pycharm and mysql problem


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?
 
Old 03-04-2017, 07:23 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Did you install pymysql?

If you did already install it, please provide the full output of the error within [code][/code] tags for easier reading.
 
Old 03-04-2017, 07:37 PM   #3
thiagofw
Member
 
Registered: Jul 2016
Location: Minas Gerais, Brazil
Distribution: Slackware 14.2
Posts: 42

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
Did you install pymysql?

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.
 
Old 03-04-2017, 07:54 PM   #4
thiagofw
Member
 
Registered: Jul 2016
Location: Minas Gerais, Brazil
Distribution: Slackware 14.2
Posts: 42

Original Poster
Rep: Reputation: Disabled
Slackware 14.2 + pycharm and mysql problem

Code:
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.
 
Old 03-04-2017, 09:51 PM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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.
 
  


Reply



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
LXer: A look at PyCharm - The Best Python IDE For Linux LXer Syndicated Linux News 0 11-25-2016 05:33 PM
[SOLVED] tar, gzip, <other> , unzip work until... Try-To-Compile-then Open from Pycharm Charliesrch Linux - Newbie 4 09-05-2015 08:28 PM
[Python] How can I install libraries and add to pycharm? samanka80 Programming 3 08-02-2015 09:14 AM
Slackware 11 + MySQL 5 boot problem Unknownlq Slackware 7 10-28-2006 05:59 PM
Slackware 10.1 and MySql Problem? bullium Linux - Networking 3 04-07-2005 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:26 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