아나콘다 주피터 노트북을 사용 시 아래와 같이 해당 패키지 라이브러리를 찾을 수 없다는 메세지가 출력될 경우
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-5-825f67b3e58c> in <module>()
      5 password = 'python'
      6 database = 'python'
----> 7 mc = create_engine("mysql+pymysql://" + user + ":" + password + "@192.168.0.21/" + database)
      8 connection = mc.raw_connection()
      9 cursor = connection.cursor()
 
~\Anaconda3\lib\site-packages\sqlalchemy\engine\__init__.py in create_engine(*args, **kwargs)
    422     strategy = kwargs.pop('strategy', default_strategy)
    423     strategy = strategies.strategies[strategy]
--> 424     return strategy.create(*args, **kwargs)
    425 
    426 
 
~\Anaconda3\lib\site-packages\sqlalchemy\engine\strategies.py in create(self, name_or_url, **kwargs)
     79                 if k in kwargs:
     80                     dbapi_args[k] = pop_kwarg(k)
---> 81             dbapi = dialect_cls.dbapi(**dbapi_args)
     82 
     83         dialect_args['dbapi'] = dbapi
 
~\Anaconda3\lib\site-packages\sqlalchemy\dialects\mysql\pymysql.py in dbapi(cls)
     60     @classmethod
     61     def dbapi(cls):
---> 62         return __import__('pymysql')
     63 
     64     if py3k:
 
ModuleNotFoundError: No module named 'pymysql'
 
 
cs

아나콘다 프롬프트를 실행시킨 후 다음과 같이 해당 모듈을 찾아서 설치를 진행합니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(base) C:\Users\Admin>conda install -c anaconda pymysql
Solving environment: done
 
## Package Plan ##
 
  environment location: C:\Users\Admin\Anaconda3
 
  added / updated specs:
    - pymysql
 
 
The following packages will be downloaded:
 
    package                    |            build
    ---------------------------|-----------------
    pymysql-0.9.1              |           py36_0         139 KB  anaconda
 
The following NEW packages will be INSTALLED:
 
    pymysql: 0.9.1-py36_0 anaconda
 
Proceed ([y]/n)? y
 
 
Downloading and Extracting Packages
pymysql-0.9.1        |  139 KB | ############################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
 
(base) C:\Users\Admin>
 
cs


'Tools > Anaconda' 카테고리의 다른 글

tensorflow 설치  (0) 2018.07.19
[에러] ModuleNotFoundError: No module named 'bcolz'  (0) 2018.07.02

+ Recent posts