Does anyone have experience using "urllib.urequest" on a pico?
I cannot import the module (via tools - manage packages (Thonny))
When I try to install it, it reports a error :-(
I would like to use it to open a url with some parameters (id, ip address)
I had the same problem too. I needed to manually install the file by downloading the package from here, extracting the files then copying the urllib folder to the lib directory on the pico.
Fortunately the file is small with no dependencies so seems to work easily enough.
Related
My latex file uses many packages which are imported with \usepackage.
On my local computer the packages are being correctly interpreted and the tex-file is compiled. When deployed on Heroku it stops running and I get plenty of error messages that some packages are missing.
For example: cmap.sty, etoolbox.sty, pdfx.sty, and many more. I started to add the files to my working directory. There are so many of them and it seems there should be an easier solution.
At the moment I am using a tex-live buildpack. I added the link to my Heroku build-packs, it does the job for simple latex files without any special packages required.
I created the file texlive.packages and added it to my repo. The file contains:
collection-bibtexextra
collection-fontsextra
collection-langgerman
collection-xetex
The deployment to Heroku is rejected because the slugfile excites more than 1.2G and only 500Mb are allowed.
These collections are quite big, and I can install max 2 of them.
I know that these collections containing a lot of packages I don't need.
How can I install only the required packages for my use case? Or how can I exclude some of them.
I imported boto3 for my lambda function in python. When i test lambda it gives this error : No module named boto3 which is rather expected.
Then i referred to the docs,to this link to be exact https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html and realized i need to create a deployment package the issue is i didn't understand the docs well enough to keep up and would like them to be explained again in a simpler way by someone that has already done the required steps.
You need to make a folder in your local system, install the required libraries into that folder, zip the contents of the folder and upload the zipped file to the AWS Lambda.
Make a folder in local system
I don't think you need help in this. Lets suppose you made a folder in D drive named yellow-bot
Install the required libraries into the folder
You can install the required packages in the folder using below command
pip install {package-name} -t "{path-to-project-dir}"
In your case it would be:
pip install apiai -t "D:\yellow-bot"
Zip the contents of the folder
Now after installing the required libraries there will be multiple files and folders in your yellow-bot folder. You need to select all and zip the content. Please note that do not zip the folder, instead you go inside the folder and zip the contents.
It would be something like below screenshot.
Create lambda function and upload zip
Now go to AWS Lambda, create a lambda function, give correct run-time and all that. Then select upload zip file in code entry type. Select your zip and click on upload.
Make sure to give correct Handler.
It follows naming convention as:
The filename.handler-method value in your function. For example,
"main.handler" would call the handler method defined in main.py.
Since in this case I have uploaded connector.py file and entry function was called lambda_handler() so correct Handler would be connector.lambda_handler
Click on Save and you are done.
Hope it helps.
I have to change my cygwin Local Package Directory, which happen to be earlier as C:\Users\username\Downloads.
Folders like http%3a%2f%2fcygwin.mirror.constant.com%2f are all in place in my new directory for Local Package Directory.
How to do that? (I cannot find, where cygwin stores the config.)
Running setup from new location tries to install all over again instead from continue using earlier packages from the internet.
The information is on /etc/setup/setup.rc
$ head setup.rc
last-cache
e:\downloads\cygwin_cache
last-mirror
http://mirrors.kernel.org/sourceware/cygwin/
net-method
Direct
last-action
Download,Install
mirrors-lst
....
Please note that setup just propose the settings based on last run but you can always change typing new values.
I'd like to use Dart on a Windows machine where my home directory is configured to be on a network share. I have no control over this configuration.
Initially, I couldn't get the Dart Editor to run at all as the default location for its configuration folder is defined in DartEditor.ini as #user.home/DartEditor. This prevented me from creating new projects at all. I have edited this file so that my Dart Editor configuration folder is now located at c:\DartEditor which seems to solve that problem.
However, when creating a new project, Pub tries to install libraries to my home directory and Dartium tries to save its configuration there as well. This causes Pub to just fail (so I can't build any projects) and Dartium to warn me that storing it's configuration on a network share will cause it to slow down.
How can I prevent Dart Editor (and any associated tools like Pub and Dartium) from using my home directory and instead use a directory on my local drive?
What about to download Dart and unzip it to:
C:\DartHome
I also recommend to change the DartEditor.ini file on the second line to:
C:\DartHome\DartEditor
According to this answer I am required to copy the pycharm-debug.egg file to my server, how do I accomplish this with a Heroku app so that I can remotely debug it using Pycharm?
Heroku doesn't expose the File system it uses for running web dyno to users. Means you can't copy the file to the server via ssh.
So, you can do this by following 2 ways:
The best possible way to do this, is by adding this egg file into requirements, so that during deployment it gets installed into the environment hence automatically added to python path. But this would require the package to be pip indexed
Or, Commit this file in your code base, hence when you deploy the file reaches the server.
Also, in the settings file of your project if using django , add this file to python path:
import sys
sys.path.append(relative/path/to/file)