pythonファイルをcx_Freezeでexe化し、実行すると、以下のエラーが発生します。
Traceback (most recent call last):
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\cx_
Freeze\initscripts\__startup__.py", line 14, in run
module.run()
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\cx_
Freeze\initscripts\Console.py", line 26, in run
exec(code, m.__dict__)
File "test.py", line 10, in <module>
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\mat
plotlib\__init__.py", line 122, in <module>
from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_lab
el
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\mat
plotlib\cbook.py", line 32, in <module>
import numpy as np
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\num
py\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\num
py\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\num
py\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\num
py\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\num
py\core\__init__.py", line 38, in <module>
from . import numeric
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\num
py\core\numeric.py", line 1820, in <module>
from .arrayprint import array2string, get_printoptions, set_printoptions
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\num
py\core\arrayprint.py", line 35, in <module>
from .fromnumeric import ravel
File "C:\Users\MIHY\AppData\Local\Continuum\Anaconda3\lib\site-packages\num
py\core\fromnumeric.py", line 15, in <module>
from . import _methods
ImportError: cannot import name '_methods'
setup.pyは次のとおりです。
from cx_Freeze import setup, Executable
import os
base = None
exe = Executable(script = 'test.py', base = base)
os.environ['TCL_LIBRARY'] = "C:\\Users\\MIHY\\AppData\\Local\\Continuum\\Anaconda3\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\\MIHY\\AppData\\Local\\Continuum\\Anaconda3\\tcl\\tk8.6"
# セットアップ
setup(name = 'test',
version = '0.1',
description = 'converter',
executables = [exe])
なお、次の3つのライブラリーをインポートしています。
from mpmath import mp
import matplotlib.pyplot as plt
import csv
setup.pyに原因があると思うのですが、どのように修正すればよいか教えていただけないでしょうか?
よろしくお願いします。