ModuleNotFoundError: no module named 'transformers' - artificial-intelligence

this is my first post and I am very new to coding so please let me know if you need more information. I have been running some AI to generate artwork and it has been working but when I reloaded it the script won't work and it is now saying "No module named 'transformers'". Can anyone help me out? It was when I upgraded to google colab pro that I started to encounter issues although I am not sure why that would make a difference
ModuleNotFoundError

Probably it is because you have not installed in your (new, since you've upgraded to colabs pro) session the library transformers. Try to run as first cell the following: !pip install transformers (the "!" at the beginning of the instruction is needed to go into "terminal mode" ). This will download the transformers package into the session's environment.

assuming you are referring to the module here: https://pypi.org/project/transformers/
you need to install transformers with pip

after you install transformers, make sure to import it , and import the Module youre gonna use

Related

How to install cinterop tool in Windows/Ubuntu

I am following this tutoriel to use C library in Kotlin (Android Studio) https://jonnyzzz.com/blog/2018/05/28/minimalistic-kn/ But I can’t find the how to install/download the cinterop tool both in Windows and Ubuntu I have the error “cinterop: command not found” ! Does anybody please knows how to install cinterop ? Thank you in advance
This tool is a part of the kotlin-native distribution, and it does not make any sense to use it without the Kotlin/Native compiler. So, in fact, you would like to get all the distribution here, and install it correctly.There are three main approaches to the Kotlin/Native installation. All of them are described in the documentation.
Installing it with the IntelliJ IDEA. You should just get an IDE and let it install everything on its own. It will download all tools and put them to the following location: ~/.konan/kotlin-native-prebuilt-<osName>-<kotlinVersion>/bin/. Then you will be able to add this folder to your PATH and call the tool from CLI.
Installing using the Gradle build system. Quite similar, but this one will require manual installation of the Gradle. The first run will also download all tools and pack them to the same location as in the IDE case.
Installing the CLI tool. This looks like the most appropriate way to follow the tutorial, but won't help a lot when you start working on more sophisticated projects. In general, you should just download the latest version of the Kotlin/Native, unpack it to some folder and add this folder to your PATH.

building flink 1.10 encountered a package not found error

I am importing flink source code to IDEA as the official website guide
error:org.apache.flink.sql.parser.impl does not exist
description:the error resulted from an import in the interface
org.apache.flink.sql.parser.utils.ParseResource
the import line is:
org.apache.flink.sql.impl.ParseException
I looked up for the "impl" package in the path but did not found it actually, I am not sure if I did something wrong following the steps, tell me if you know?
Some parts are generated through maven plugins. Make sure you either run a full mvn install locally before importing, or use IntelliJ generate source feature

React Native: NPM Module being uninstall each time a new is installed

I am using a package named react-native-linear-gradient which can be found here. I had to go through quite a lengthy process to eventually get the link to my project (by manually linking via the Binary link with libraries in XCode. I got it working fine, however, each time I install a new package via NPM, linear-gradient is removed from my node-modules folder.
1.Can anyone shed some light on why this is happening? (Happy to provide additional information)
2.Will this impact deployment of the application if this is not solved?
SOLVED: Downgraded to 5.7.1... It seems 5.8.0 seems to cause the same error Michael mentioned.

Running GAE GCS on PyCharm under OS X, runtime error "No module named cloudstorage"

I am trying to add Google Cloud Storage functionality to a Python GAE app that is already running with significant functionality. I work entirely within PyCharm on my development computer, which is a Mac running OS X 10.9.5.
I have created a new Python module that contains this statement:
import cloudstorage as gcs
as shown in the sample code at https://cloud.google.com/appengine/docs/python/googlecloudstorageclient/getstarted
When I first added that line, PyCharm said "No module named cloudstorage" in the editor.
I then followed both the "pip" and the "svn" instructions at https://cloud.google.com/appengine/docs/python/googlecloudstorageclient/download
to download the GCS Client Library.
In trying to follow those instructions, taking into account my prior experience with this programming environment, I actually tried using "pip" three times:
Once without the "-t" option, since I've never needed that option with "pip" before
Once using the "-t" option to specify my application directory's "lib" subdirectory
Once using:
pip install GoogleAppEngineCloudStorageClient -t /Applications/GoogleAppEngineLauncher.app//Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib, since I wasn't sure what the instructions meant by "<your_app_directory/lib>"
As mentioned, I also executed the "svn" command. Then, as mentioned in install python google cloud storage client on Ubuntu 14.04, I ran "cd gcs-client/src" and "sudo python setup.py install". I ran these commands in my user root directory.
After each of those successful but different installations of the GCS Client Library, I looked at the PyCharm editor window for my module, and it always had the same "No module named cloudstorage" error. But as an experiment, I would also try restarting PyCharm, and also try running my app.
At some point, the editor window stopped showing the error. It was not immediately after one of those steps above, but after I would go away to read various webpages and then come back to look at the error again. I don't know which of the installations was the one that got rid of the error message in the PyCharm editor.
In any case, whenever I try to run the app (again, inside PyCharm), I always get the runtime error "ImportError: No module named cloudstorage" on the same import statement.
The Run/Debug Configuration page for this app has both "Add content roots to PYTHONPATH" and "Add source roots to PYTHONPATH" checked.
Of course the main help I want is how to get past the "No module named cloudstorage" runtime error, even though the import statement no longer shows an error.
I think I also have as many as three spurious versions of the GCS Client Library. I'm much more concerned with getting past "Module not found", since it's a show-stopper, but if you have any idea how I can delete the spurious versions so that they're not just lying around, I'd be most grateful for that help as well.
If the "cloudstorage" directory is at <app>/lib/cloudstorage, then the import statement has to specify "lib":
import lib.cloudstorage
In my case, it's:
import lib.cloudstorage as gcs
By the way, the <app>/lib/GoogleAppEngineCloudStorageClient-1.9.5.0-py2.7.egg-info directory does not seem to be needed and can be deleted.
Actually, you also need to
touch __init__.py
in the lib directory. This will make the cloudstorage module visible to the "import lib.cloudstorage" command.
Dear Google: The distributions should include this file (or the procedure should account for it), and the demo script should be changed to reflect the expected usage. But more importantly why are you distributing/PROLIFERATING library code like this??!!! Why is this not distributed via gcloud? How am I ever going to pick up a patch for this library?
The accepted answer's solution
import lib.module_name
definitely can solve the problem. But I don't like add lib in front of every single module and happened to see how Google suggest import third party libs like this.
appengine will automatically run a file called appengine_config.py. So you can create such a file and put
from google.appengine.ext import vendor
vendor.add('lib')
inside that file. This will help you tell appengine to find dependencies in that folder, so you can simply write
import cloudstorage as gcs
I solve the missing module issue by adding the following to my main application file (main.py):
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
I think this is the way Guido intended. Now my code simply says import cloudstorage as gcs. None of the lib.cloudstorage or lib/__init__.py business.
From
https://stackoverflow.com/a/37645984/1740008

qpython not able to download requests module

I am using qpython for programming python on android.In my script I am importing requests module and so I have tp install requests module from pip.When I run pip install requests command I get the following error:
error build/lib.linux-armv71-2.7/requests/auth.py:operation not permitted qpython
I get this error twice while installing requests and so I am not being able to run my script.
You might need to manually download requests, extract and move it to your Lib/site-packages/Requests/ folder, from there python should be able to import from it. I don't see that package available for qpython, it might work out of the box or it might still need to be ported.
After installing qpython on my current device I was able to open the app, go to My QPython ->Scripts and use pip_console.py to try to install it but as you said it fails. I'm going to test later my above recommendation. My install directory is /sdcard/com.hipipal.qpyplus/lib/python2.7/site-packages/ and that is where I'm going to drop the requests library.
To run pip on qpython just use the steps below:
import pip
pip.main(['install', 'bs4'])
The above is to install bs4 for BeautifulSoup. Worked for me :)
The newest version ( 1.3.1 ) from google play has fixed this issue.
This solution did not work or me...but I did resolve it by downloading the new beta v2.1 from
https://github.com/qpython-android/qpython/releases
Google play did not give me the latest version (I had 1.xx)
I was able to use QPYPY to install requests and it automatically installed the required library urllib3.

Resources