This is Ogadora. As the title says. I spent more than a day on this, so it was a memorial service. It's basically the same as the Anaconda environment, but it seems to throw an error because the required modules are not installed. I have already installed Python, so I don't want to install Anaconda> <I recommend it to people. But it's a hassle, so unless it's too bad, let's install Anaconda. My environment is Windows 10.
It seems that Python will not work unless it is a 32-bit version. Please download from here. I downloaded and installed the Windows x86 web-based installer.
PS C:\WINDOWS\system32> py -3.8-32 -V
Python 3.8.3
If it is displayed like this, it is OK. When coexisting with the 64-bit version, the 64-bit version will be called unless the -3.8-32 (3.8 changes depending on the version) option is specified.
PS C:\WINDOWS\system32> py
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
PS C:\WINDOWS\system32> py -3.8-32
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
You can check it like this. Also, to explicitly call the 32-bit version with pip
py -3.8-32 -m pip install hogehoge
Please keep in mind.
By the way, let's upgrade pip.
py -3.8-32 -m pip install --upgrade pip
next CaboCha & Python3 environment construction (Windows version) Please make various preparations by referring to. To summarize the procedure briefly
This is different from Anaconda. It's a Numpy module, but it can't be used if it's installed with pip. It seems that it is included as standard in Anaconda, but it will be a little troublesome in a non-Anaconda environment. By the way, if you try to use CaboCha as it is
Traceback (most recent call last):
File "A:/codes/python/test.py", line 4, in <module>
import CaboCha
File "C:\Users\ogadra\AppData\Local\Programs\Python\Python38-32\lib\site-packages\CaboCha.py", line 28, in <module>
_CaboCha = swig_import_helper()
File "C:\Users\ogadra\AppData\Local\Programs\Python\Python38-32\lib\site-packages\CaboCha.py", line 24, in swig_import_helper
_mod = imp.load_module('_CaboCha', fp, pathname, description)
File "C:\Users\ogadra\AppData\Local\Programs\Python\Python38-32\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\ogadra\AppData\Local\Programs\Python\Python38-32\lib\imp.py", line 344, in load_dynamic
return _load(spec)
ImportError: DLL load failed while importing _CaboCha:The specified module cannot be found.
Process finished with exit code 1
I get an error like this. I struggled to say, "Which is the specified module? !!!"
First of all, if you already have numpy, uninstall it.
py -3.8-32 -m pip uninstall numpy
Then install Wheel. Wheel is like a library needed to load a python module from a whl file.
py -3.8-32 -m pip install wheel
Next, check the version that can be installed with wheel. If you want to use PowerShell as it is, please do as follows.
PS C:\WINDOWS\system32> py -3.8-32
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wheel.pep425tags
>>> print(wheel.pep425tags.get_supported(-1))
C:\Users\ogadra\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wheel\pep425tags.py:80: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
if get_flag('Py_DEBUG',
[('cp38', 'cp38', 'win32'), ('cp38', 'none', 'win32'), ('cp38', 'none', 'any'), ('cp3', 'none', 'any'), ('cp37', 'none', 'any'), ('cp36', 'none', 'any'), ('cp35', 'none', 'any'), ('cp34', 'none', 'any'), ('cp33', 'none', 'any'), ('cp32', 'none', 'any'), ('cp31', 'none', 'any'), ('cp30', 'none', 'any'), ('py3', 'none', 'win32'), ('py38', 'none', 'any'), ('py3', 'none', 'any'), ('py37', 'none', 'any'), ('py36', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]
>>>
A list will be returned.
How to read this list
('cp38', 'cp38', 'win32')
When there is a notation
hogehoge-cp38-cp38-win32.whl
It corresponds to the installation of the file, it is OK if you catch it.
I think that Python 3.8.X environment supports cp38.
The whl file can be installed from here.
There are various things, but I will download it using Ctrl + F etc.
In my environment, I downloaded the following files. (Maybe there are some that you don't need)
・ Numpy-1.19.0 + mkl-cp38-cp38-win32.whl ・ Scipy-1.5.1-cp38-cp38-win32.whl ・ Scikit_learn-0.23.1-cp38-cp38-win32.whl ・ Pandas-1.0.5-cp38-cp38-win32.whl ・ Matplotlib-3.3.0rc1-cp38-cp38-win32.whl
To install from the whl file, cd to the directory where you saved the whl file and cd
py -3.8-32 -m pip install [file name]
You can do it. To check if numpy with mkl is installed
import numpy as np
np.show_config()
Then various things will come out.
blas_mkl_info:
If the item of is not ** NOT AVAILABLE **, the installation is completed normally. See Scipy in the same way.
You should now have CaboCha installed in a non-Anaconda environment. For confirmation, I think it is good to run the code of Reference site. (Because it supports Python3.) If it doesn't work, try the following. -Reinstall Cabocha, MeCab (check again if it is installed with UTF-8) ・ Try installing cabocha from whl The latter can be downloaded from here.
Thank you for your hard work. Have a good Japanese analysis life!
Recommended Posts