pycrypto develoment server error "from Crypto.Cipher import blockalgo" - google-app-engine

I have installed pycrypto version 2.6 , and i am getting this error
from Crypto.Cipher import blockalgo
ImportError: cannot import name blockalgo
I have read many post but i am unable to solve this problem

If you are not able to import anything from Crypto.Cipher at all, it might be due to folders, crypto and respective egg info, under site-packages are created with lower-case 'c'
/Library/Python/2.7/site-packages/crypto
/Library/Python/2.7/site-packages/crypto-1.0.0-py2.7.egg-info
Imports were successful when same case was used while importing
from crypto.Cipher import AES
or renaming the folders
/Library/Python/2.7/site-packages/Crypto-1.0.0-py2.7.egg-info
/Library/Python/2.7/site-packages/Crypto
I went with the later, to have consistency with others.
I use Eclipse and was able to overcome this problem using one of the above solutions.
Sometimes we overlook these kind of details easily. Its a long shot, hope this helps!

Related

How to solve this error: Failed to resolve import "part:#sanity/base/schema-creator" from "schemas/schema.js"

I have the following error:
plugin:vite:import-analysis] Failed to resolve import "part:#sanity/base/schema-creator" from "schemas/schema.js". Does the file exist?
It looks like sanity/base dependency is non existent but every time I go to install it the version is not compatible with React 18.2. Is React 18.2 really not compatible or is there something else probably wrong?
Also it may be worth noting that I got the above error after solving this error: "Failed to resolve import "./schemas" from "sanity.config.js"." What I did was change my import in the sanity.config.js to import {schemaTypes} from './schemas/schema'.
I tried npm ls #sanity/base to see if it was there. I also tried npm install #sanity/base and it looked like the versions between React 18.2 and Sanity were incompatible.
I would rather not go to later version of React and ReactDom so I was seeing if there was possibly something else going on.
It turns out I was using version 2 code for version 3 sanity. I migrated everything to the version 3 format. here is the link to the migration setup:https://www.sanity.io/docs/migrating-from-v2.

object johnsnowlabs is not a member of package com

I am very new to Zeppelin/spark and couldn't get an accurate description of steps to configure new dependencies like that of NLP libraries.
Found similar issue here.
I was trying to use Johnsnowlabs NLP library in Zeppelin notebook (spark version2.2.1).
Setup included :
In Zeppelin's Interpreters configurations for Spark, include the following artifact:
com.johnsnowlabs.nlp:spark-nlp_2.11:2.5.4
Then, in conf/zeppelin-env.sh, setup SPARK_SUBMIT_OPTIONS.
export SPARK_SUBMIT_OPTIONS=” — packages JohnSnowLabs:spark-nlp:2.2.2". Then restarted Zeppelin.
But the below program gives the error :
%spark
import com.johnsnowlabs.nlp.base._
import com.johnsnowlabs.nlp.annotator._
<console>:26: error: object johnsnowlabs is not a member of package com
import com.johnsnowlabs.nlp.base._
^
<console>:27: error: object johnsnowlabs is not a member of package com
import com.johnsnowlabs.nlp.annotator._
Can someone please share how this can be done? I referred this link .
TIA
you don't need to edit the conf/zeppelin-env.sh (anyway you're using it incorrectly, as you're specifying completely different version), you can make all changes via Zeppelin UI. Go to the Spark interpreter configuration, and put com.johnsnowlabs.nlp:spark-nlp_2.11:2.5.4 into spark.jars.packages configuration property (or add it if it doesn't exist), and into the Dependencies at the end of configuration (for some reason, it isn't automatically pulled into driver classpath).

How to load .web extenstion files in React Native Web with Typescript

In the case of react native web we have a possibility to use files with .web and .android extensions.
Eg.
myFile.web.js
myFile.android.js
then we can include them via
import myFile from './myFile';
and React native web automatically provides proper file content depends on the platform.
It works so far but after I added Typescript the ts compiler started to complain about the missing module 'myFile' and it's logically okay because we don't have this file and TS compiler doesn't know that the RNWeb will automatically pick a proper file later.
When I disabling Typescript, everything works fine so the system is working.
The question is how to solve it in the case of Typescript?
Thanks for any help.
The only way I found how to avoid this issue is using CommonJS module system - require instead of ES6 - import standard
Example: const MyFile = require('./myFile')
In this case, the TS compiler will ignore it. Unfortunately, it isn't a perfect/right solution as I'd like to see but it works so I just use it as is.
P.S. If someone finds another way, please, provide your solution, I'll be appreciated.

Failed to compile ./src/index.js Module not found: Can't resolve 'react' in

Because I cannot ask a question here due to some reputations thing someone came up with, this is the best way I found to actually get help. Check the image if you consider helping even if in a not so conventional way.
it's legitimate and it's sad people go by a points system to offer help....
Alright, I figured it out. My problem was that I did not initialize my bundle in my Public/index.html path. I'm sorry if this was a very obvious solution but I'm just learning React now and thought that "import" would do everything for me...
I was encountering this same problem with an angular 6 app and the problem was that I had VS Code doing automatic import. VS code used this:
import {EventEmitter} from 'protractor'
instead of what I needed:
import { EventEmitter } from '#angular/core';
Moral of the story: check your import statements before panicking about compatibility issues.

importing a git-submodule into a golang gae app

I have a submodule in my golang google-app-engine project that I would like to add to my path.
$ ls ./openid/src/openid
discover.go integration verify.go
discover_test.go nonce_store.go xrds.go
discovery_cache.go nonce_store_test.go xrds_test.go
fake_getter_test.go normalizer.go yadis_discovery.go
getter.go normalizer_test.go yadis_discovery_test.go
html_discovery.go redirect.go
html_discovery_test.go redirect_test.go
In the example code for this package, it imports "openid". I'm new to golang's import rules, and I can't for the life of me figure out what I need to put in the import statement of my main file to import this package. I've tried "openid/src/openid", "myapp/openid/src/openid", etc. Can someone provide some clarification of how this works? Or do I need to actually modify the app.yaml file?
"Organizing Go code" mentions:
An import path is the string with which users import a package.
It specifies the directory (relative to $GOROOT/src/pkg or $GOPATH/src) in which the package's source code resides.
So make sure to use an import statement referring to a path which exists in your $GOPATH/src. (GOPATH being your "workspace", in which you have namespaces, as shown in this video).
Also make sure you build first openid/src/openid sources. And install it (go install).
As detailed in this answer:
Import paths can be be globally unique.
In conjunction with GOPATH, import path can be translated unambiguously to a directory path.
Any directory path under GOPATH can be unambiguously translated to an import path.

Resources