I have a problem. I have installed Rasa and all the required packages. But when I am trying to run my code it gives this error:
from rasa_core.channels.console import ConsoleInputChannel
ImportError: cannot import name 'ConsoleInputChannel' from 'rasa_core.channels.console' (/usr/local/lib/python3.7/dist-packages/rasa_core/channels/console.py)
What am I doing wrong?
It looks like your code was written for an older version of Rasa than the one you are using to run it. According to the migration guide, ConsoleInputChannel has been removed. The documentation at https://github.com/RasaHQ/rasa/blob/master/docs/core/old-core-migration-guide.rst#changes-to-input-and-output-channels says:
ConsoleOutputChannel and ConsoleInputChannel have been removed. Either use the run script to run your bot on the cmdline, or adapt the serve_application function to run from a python script.
You can try installing an old version, if you know which one it needs, or you can adapt your program to work with the current version of Rasa.
Related
I'm tyring to import wolfamalpha into my code but it gives a error saying:
ModuleNotFoundError: No module named 'wolframalpha'
I tried installing it with pip install wolframalpha, but it still doesn't work.
Here is my code:
import wolframalpha
client = wolframalpha.Client('*************')
When you run your python file, are you sure that you are using the correct python interpreter that you performed the pip install wolframalpha to? It sounds like you may have multiple versions of python on your machine and there is a mismatch. If you are using VSCode, it is easy to see which interpreter is running on the bottom of the screen, which may help you debug the issue.
I'm new to Django and I try to develope a plugin for NextBox using this framework. To get familliar with it I'm using documentation from NextBox for this. My Problem is that I try to import a class as shown in the tutorial I get an Error that the package is unkown. When I want to install the package via PyCharm it seems to be the wrong one. Maybe someone of you can help me?
Doc: https://netbox.readthedocs.io/en/stable/plugins/development/
from extras.plugins import PluginConfig
class NextBoxUIConfig(PluginConfig):
In the IDE it says that extras is unkown after installing the package, .plugins is unkown as well as PluginConfig
The Solution is that the plugin has to be installed using $ python setup.py develop for development purposes. To install the plugin is necessary to have local netbox version installed. After using the command the name of the plugin has to be added to the netbox file configuration.py:
PLUGINS = [
'plugin_name',
]
But be sure to use the same venv you use to run netbox when installing the plugin with the listed command. After that the IDE will probably say it doesn't know what extras.something is. But it's installed and netbox will recognize when the plugin uses some netbox specific classes.
For more information use the netbox documentation:
https://netbox.readthedocs.io/en/stable/plugins/
Trying to access the todoist api, and I copied some code from the api documentation. However, on my system I get an error stating:
Unable to import 'todoist.api'pylint(import-error).
I installed it with:
pip install todoist-python
as mentioned in the documentation
from todoist.api import TodoistAPI
I get my error on the very first line. How do I not get this?
You did everything right, so it's probably related to the way your installation is set.
Be sure you are using the same python you used to install the library. Check if the library is installed (pip list) and check if you're using the right Python when running the code. It's possible that the library was installed in one version and you're using the other.
I had the same problem, I solved it by following the GitHub instructions, but the name of the module to install using pip is todoist.
I'm trying to set up a roguelike Python project, but I can't seem to be able to import libtcod module into my project. This helloworld crashes, and the IDE keeps telling me that there is no module named libtcodpy.
import libtcodpy
def main():
print('Hello World!')
if __name__ == '__main__':
main()
What is the proper way to import modules into Python projects? I'm used to Java, so I was expecting something along the lines of Maven to manage the dependencies. There indeed seems to be something like that in PyCharm as well, this package manager for the venv, which from what I gather serves to isolate the project-specific stuff from the OS- or python-global stuff:
but libtcod simply isn't present in the rather exhaustive list of modules that appears after clicking on the "+" button, just some other module that has something to do with libtcod library (I guess?). Moreover, all the tutorials I found on setting libtcod up advise one to manually copy over files somewhere or run some command that I suppose does the importing somehow and other such solutions, all of which i tried and none of which worked. I don't want to pollute my project structure by using such hodgepodge ways of handling dependencies if I can at all avoid it.
Q: How do I get libtcod to work in my PyCharm project in the most clean and convention-abiding way possible?
Take a look at this github project called tcod: https://github.com/libtcod/python-tcod/blob/master/README.rst#installation
It's a python port of libtcod.
To install using pip, use the following command:
python -m pip install tcod
If you get the error "ImportError: DLL load failed: The specified module could not be found." when trying to import tcod/tdl then you may need the latest Microsoft Visual C runtime.
Blockquote
I am relatively new to programming and posting to Stack Overflow. Please forgive my ignorance.
I am attempting to use a third party module in a program of my own, however I can't work out how to access the module within my Python script.
Mac OS X Sierra 10.12.4
Python 3.6.1
Anaconda 4.3.1
Specifically, I would like to be able to access anki (https://github.com/dae/anki).
I initially tried the line:
from anki import Collection
That resulted in a 'ModuleNotFoundError'.
Next I tried:
conda install anki
which also didn't work and yielded a 'PackageNotFoundError'
After more searching, I decided to try:
import sys
sys.path.append('usr/share/anki')
from anki import Collection
However, this also results in a 'ModuleNotFoundError'
What do I need to do to be able to access this module?
I am sure that it is possible because I have come across several other programs which make use of it:
-https://eshapard.github.io/anki/open-the-anki-database-from-python.html
I recognize that the link above purports to offer a solution to exactly this problem, however the solution proffered isn't working for me. Thanks in advance.
You are telling about Anki for desktop computers, which IS application written in Python, but it is NOT an installable Python package.
So the commands like
conda install anki
or
pip install anki
have no meaning.
So the only way is to download full source code of this project, unzip the content of it (only) folder into your project (change you actual folder to it) and then you may do import commands.