I am learning Natural Language Processing using the book NLP in action. The module nlpia has to be installed and imported to successfully run the code listings given in the book. For the same, the author directs the readers to the web address: https://github.com/totalgood/nlpia/tree/master/docs
Now I have created the environment suggested by the author. But I am unable to find where to execute the following command:
python -c "print(import nlpia)"
This command has to be executed to be able to successfully import the module nlpia. I tried executing the command in the Anaconda cmd prompt and GIT Terminal to no successful end. Can someone please tell me where this command has to be executed?
The error I received while I typed in the command in Anaconda cmd prompt:
print(import
^^^^^^
SyntaxError: invalid syntax
Related
I installed Truffle, the Ethereum development toolkit, on my Ubuntu 14.04 PC. I can execute it easily from a terminal window by simply typing "truffle". However, when I try to execute Truffle from a Bash shell script, I get the following error:
ide-do-truffle.sh: line 3: truffle: command not found
The line inside the shell script is just:
truffle compile --network local
How can I execute Truffle from within a shell script?
If someone can also explain what goes on behind the scenes when you execute a globally installed Node.JS package like Truffle, that would be helpful too.
Its possible the PATH in your terminal window is not the same as the PATH that your shell script sees.
Try echo "$PATH" in both your terminal window and in your script just before your truffle line in your script, and compare the two. If there is a difference, then the problem is with the PATH in your shell script.
I'm watching a video on YouTube that that is telling me to type cd documents and then within that file type cd python to connect python, but every time I try this it says "the system cannot find the path specified" I don't understand why it is saying this because I can see that python is in my documents folder.
If you are using Windows CMD or Powershell, use the command py instead of python.
Example: py myscript.py (or py.exe .\myscript.py also works)
if you want to run the python code which is located in your documents folder then open cmd and type "cd documents" and if your python code is in same folder then type "python 'filename'.py" pre enter to run
When I am trying to launch Anaconda prompt it says that
Unable to create process using 'C:\ProgramData\Anaconda3\python.exe C:\ProgramData\Anaconda3\Scripts\conda-script.py shell.cmd.exe activate activate C:\ProgramData\Anaconda3'
From this answer I tried to run C:\ProgramData\Anaconda3\python.exe C:\ProgramData\Anaconda3\Scripts but I got
'C:\ProgramData\Anaconda3\python.exe' is not recognized as an internal or external command,
operable program or batch file.
Execute the following command in your terminal to activate the conda environment:
C:\Users\YOUR_USERNAME\Anaconda3\Scripts\activate
You need to replace YOUR_USERNAME with your own username. If you have installed conda at some custom-specified location, only then you need to replace the initial part of the command (C:\Users\YOUR_USERNAME\Anaconda3\Scripts) with the path of actual conda installation.
After activating, conda commands would work in the terminal.
I download the external python package called morfessor and installed using pip install morfessor. To use the package there are command line commands such as morfessor-train, the syntax is:
morfessor-train --encoding=ISO_8859-15 --traindata-list --logfile=log.log -s model.bin -d ones traindata.txt
I tried by specifying the path into the folder where the commands are available,
as: C:\Python34\Scripts\Morfessor-2.0.3\scripts
the error here occur is "morfessor-train is not recognized as an internal and external command, operable program or batch file"
when I tried also using the python -m mofessor-train. but it said that "no module named morfessor-train"
how can run or use the commands from the command line to access the package?
I am trying to debug an application remotely in Eclipse. When I start debugging, the application is deployed and the gdbserver is started on the target. This seems to work automatically without any mistakes, but then following error occurs:
'Launching helloworld Build(GNU)' has encountered a problem.
Could not determine GDB version using command: /usr/bin/gdb --version
When I expand <<Details in Eclipse this is shown:
Could not determine GDB version using command: /usr/bin/gdb --version
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
In a console on the target /usr/bin/gdb --version is showing me the version and when I open a Python shell I can import encodings without errors.
Does anybody know where this error comes from? I wasn't sure about how to tag this question since I have no clue in which area the solution will be.
What I tried so far:
In Eclipse/Debug Configurations: Commands to execute before application: Several export commands to Python.
Same in /etc/profile.
bitbake -e python | grep "^PACKAGES=" : Inserted every python package into my image recipe via IMAGE_INSTALL_append.
[...]