Comments (11)
The error message says No module named pattern.db
. It means it can not find the pattern package.
Please add Python to the PATH before you ran devtools::install_github("bnosac/pattern.nlp", args = "--no-multiarch") and make sure you install the pattern package correctly meaning it ends up in the Python modules folder.
from pattern.nlp.
Thanks for your quick reply.
If I well understand, I need to move the Python folder to the pattern.db folder, correct?
Unfortunately I'm an analyst and not a developer, so this is not really clear for me. Thanks in advance for your help
from pattern.nlp.
You need to put Python in your PATH. Have you done this? What does Sys.getenv("PATH")
give you? Is the location of Python in there?
from pattern.nlp.
This is the PATH result:
/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
but I've got it with the command : $; echo $PATH
from pattern.nlp.
This means that Python version 3.4 is the first in the search path. The following R code will probably give you the location of Python version 3.4?
library(findpython)
find_python_cmd()
The installation instructions at
https://github.com/bnosac/pattern.nlp indicate that this will only work for python 2.5+
Change your PATH accordingly to make sure it finds Python version 2.5+ instead of version 3.4. Ask that to your local admin or set the PYTHON environment variable or do something like this
options(python_cmd = "/Library/Frameworks/Python.framework/Versions/2.7/bin/python")
devtools::install_github("bnosac/pattern.nlp", args = "--no-multiarch")
from pattern.nlp.
Thanks a lot for your support. I've followed your instructions installing findpython and running the command
options(python_cmd = "/Library/Frameworks/Python.framework/Versions/2.7/bin/python")
now the error is:
Skipping install of 'pattern.nlp' from a github remote, the SHA1 (0802212) has not changed since last install.
Use force = TRUE
to force installation
I've also tried to change the PATH from the terminal with the following command:
sudo -s 'echo "/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin" >> /Library/Frameworks/Python.framework/Versions/2.7/bin/Python'
but the output is always (no matter which folder I try to set)
No such file or directory
I've tried to remove and install Python again, I've tried to remove SPSS that has a Python module inside, and I've tried to reinstall Sierra on the computer again. Nothing seems to solve the problem. I have two computers and the problem is the same in both machines.
Do you have any other suggest? Thanks a lot
from pattern.nlp.
You haven't given the output of
library(findpython)
find_python_cmd()
Neither provided information on your computer - is it Linux/Mac or are you in Windows on another shell?
The first thing you got "Skipping install of 'pattern.nlp' from a github remote, the SHA1 (0802212) has not changed since last install. Use force = TRUE to force installation" is that apparently you already installed pattern.nlp, the output of devtools::install_github indicates that you need to use the following for your case
options(python_cmd = "/Library/Frameworks/Python.framework/Versions/2.7/bin/python")
devtools::install_github("bnosac/pattern.nlp", args = "--no-multiarch", force = TRUE)
Please look online on how to set the PATH and how to set an environment variable called PYTHON to your non-standard location where you installed python ("/Library/Frameworks/Python.framework/Versions/2.7/bin/python"). The sudo command just isn't setting the PATH. You can just google on that.
from pattern.nlp.
find_python_cmd()
[1] "/Library/Frameworks/Python.framework/Versions/2.7/bin/python"
My computer is a Mac with Sierra on
I've looked dozen of results on google about changing the PATH, and tried a lot of ways. I'll find more and I'll post a question on stackoverflow, maybe I will find a solution
I would love to add your package on my course about text mining and my book, but it's really complicated to install
from pattern.nlp.
Did you install the pattern Python package as indicated in the README
as such, is it in /Library/Frameworks/Python.framework/Versions/2.7/Lib/site-packages ?
from pattern.nlp.
From the begin the steps I followed:
-
Removed all Python versions
-
Installed Python 2.7 again
-
Downloaded pattern 2.6 folder from this link http://www.clips.ua.ac.be/pages/pattern
-
put the pattern 2.6 folder to this folder
/Library/Frameworks/Python.framework/Versions/2.7/lib/site-packages
-
from the terminal, I had run
cd pattern-2.6
python setup.py install
- then went to R, required findpython and set the directory with the following code
options(python_cmd = "/Library/Frameworks/Python.framework/Versions/2.7/bin/python")
then installed pattern.nlp with
devtools::install_github("bnosac/pattern.nlp", args = "--no-multiarch", force = TRUE)
The output is:
Traceback (most recent call last):
File "", line 1, in
ImportError
:
No module named pattern.db
Error : .onAttach failed in attachNamespace() for 'pattern.nlp', details:
call: PythonInR::pyExec("from pattern.db import *")
error: An error has occured while executing Python code. See traceback above.
Error: loading failed
Execution halted
ERROR: loading failed
- removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/pattern.nlp’
- restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/pattern.nlp’
Error: Command failed (1)
I've also tried to move the folder to Versions/2.7/bin, but nothing changes.
from pattern.nlp.
pattern.nlp
uses the following code to try to find the Python pattern package which should be installed at your computer. As long as this fails, you can not install pattern.nlp
library(findpython)
can_find_python_cmd(required_modules = "pattern.db")
What you can do is look at the help of ?can_find_python_cmd or look at the source code of edit(find_python_cmd)
or edit(can_find_python_cmd)
to see what this function does and set the environment variables which are used there to match your specific system and non-standard location where you put Python and the Pattern package.
from pattern.nlp.
Related Issues (13)
- Cannot use := to add columns to a null data.table (no columns), HOT 2
- Dutch sentiment analysis not working HOT 7
- How to apply to large dataframe HOT 6
- PyhtonInR not available anymore HOT 1
- Installation on R 3.3.2 HOT 3
- Error when the input string does not contain any token HOT 2
- issue while installing pattern.nlp in R HOT 20
- Error installation Python HOT 1
- I can't install the package HOT 4
- Error in pyExec HOT 3
- Installation error HOT 13
- Both R and Python are 64-bit but the installation fails with 32 vs 64 bit error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pattern.nlp.