Export equivalent for windows? - django

I am following a tutorial on building a simple website using django. I am at the stage of preparing my website for deployment. However, when I try to enter
export READ_DOT_ENV_FILE=True
into the terminal, I get the error message:
export : The term 'export' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ export READ_DOT_ENV_FILE=True
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (export:String) [], CommandNotFoundE
xception
+ FullyQualifiedErrorId : CommandNotFoundException
I am a windows user, and the tutorial person is a mac user. I don't know why I am getting this error, and I hope you guys could help me export this code. Here are some codes in my settings file for your reference:
READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE', default=False)
if READ_DOT_ENV_FILE:
environ.Env.read_env()
Thanks a lot!

On windows you should run:
setx export READ_DOT_ENV_FILE=True

Related

Error with modules gumdrop-cli.ts metaplex

I've been testing metaplex and wanted to try testing gumdrop, I downloaded the gumdrop repo from here https://github.com/metaplex-foundation/gumdrop/ and tried running it but it didn't work. I then placed it inside the original metaplex folder (~/metaplex/js/packages/gumdrop) as I thought that would maybe fix it but I now run into this error:
C:\Users\Shady\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:843
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
~/metaplex/js/packages/gumdrop/packages/cli/src/gumdrop-cli.ts:4:10 - error TS2305: Module '"commander"' has no exported member 'program'.
4 import { program } from 'commander';
~~~~~~~
~/metaplex/js/packages/gumdrop/packages/cli/src/gumdrop-cli.ts:11:8 - error TS2307: Cannot find module '#aws-sdk/client-sesv2' or its corresponding type declarations.
11 } from '#aws-sdk/client-sesv2';
~~~~~~~~~~~~~~~~~~~~~~~
~/metaplex/js/packages/gumdrop/packages/cli/src/gumdrop-cli.ts:13:26 - error TS2307: Cannot find module 'discord.js' or its corresponding type declarations.
13 import * as discord from 'discord.js';
copying the repo into the old location is not correct. It only causes those package issues that you saw.
To make the gumdrop cli work you
need to have yarn installed.
Should run yarn install in the packages/cli folder
Run the cli with ts-node

On ' npm test login.component.spect.ts ' , it says Cannot find module '#app/store/user/user.actions' from 'login.component.ts'

I am new to Ngrx and its UnitTesting , Can anyone help me with the best tutorial or link to learn
I am facing an error ,
On ' npm test login.component.spect.ts ' , it says
Cannot find module '#app/store/user/user.actions' from 'login.component.ts' , in Testbed how to import actions and reducer file
Though i've imported the action and reducer file in spec and Ts file , still i am getting an above error.
You probably have to define your paths inside the tsconfig.spec.json.
If you're using jest you also have to define some moduleNameMappers.

gsutil command crashes every time on Windows 10

Whenever I run some gsutil command, for example gsutil components update, it exits with this error:
ERROR: gcloud crashed (LookupError): unknown encoding: cp65001
If you would like to report this issue, please run the following command:
gcloud feedback
To check gcloud for common problems, please run the following command:
gcloud info --run-diagnostics
Running gloud info --diagnostics as it suggests also fails with the same error:
Network diagnostic detects and fixes local network connection issues.
Checking network connection...failed.
ERROR: gcloud crashed (LookupError): unknown encoding: cp65001
Does anybody know how to fix this?
I've tried setting PYTHONIOENCODING=UTF-8 (Python 2.7 : LookupError: unknown encoding: cp65001) but it didn't help, I think gsutil uses its own Python and it might be ignoring/resetting this variable.
Edit:
I'm using Powershell, it already has UTF-8 set as the encoding:
[Console]::OutputEncoding
BodyName : utf-8
EncodingName : Unicode (UTF-8)
HeaderName : utf-8
WebName : utf-8
WindowsCodePage : 1200
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
IsSingleByte : False
EncoderFallback : System.Text.EncoderReplacementFallback
DecoderFallback : System.Text.DecoderReplacementFallback
IsReadOnly : True
CodePage : 65001
Reinstalling the Cloud SDK with "Bundled Python" unchecked did the trick for me. I have Python 2.7 installed independently.
Just run:
set PYTHONIOENCODING=UTF-8

Error:- tensorboard: command not found . However, while typing locate tensorboard, I am getting the the location

I am a beginner in tensorflow. I ran a simple script as below :
import tensorflow as tf
a =tf.constant(2)
b = tf.constant(3)
c = tf.add(a,b)
with tf.Session() as sess:
writer = tf.summary.FileWriter('./graphs',sess.graph)
print sess.run(c)
writer.close()
After saving this python file, I ran it in terminal. There is folder graphs created with 2 events file. Then I ran following command on terminal :
tensorboard --logdir="./graphs"
I am getting following error:
tensorboard: command not found
Please help. Thanks in advance.
​
As you mentioned you are getting tensorboard location, try to run your command with your local path, ex
/your/path/tensorboard --logdir="./graphs"
Hope this will help you, happy coding

python not accessible in powershell v3 when opened with Popen

Hopefully this should be simple. Python environment is running fine if I open PowerShell v3 manually. I can check version and run external scripts etc. But as soon as I open powershell.exe through subprocess.Popen from a python script from another application, python simply won't run; "The term 'Python' is not recognised as the name of a cmdlet, function, script file or operable program... etc"
I've checked my environment paths repeatedly and python is running fine on the system in general.
anyone has any idea what this could be caused by?
subprocess.Popen(["powershell.exe", '-ExecutionPolicy', 'RemoteSigned', "path to PS1_script_with python command"])
My PS1 file looks like this:
cd C:\Users\David\Geeknote\geeknote-master\geeknote
python gnsync.py --path "C:\Users\David\Desktop\C4DtoEvernote", --mask "*.nfo", --notebook "Python Logs"
function Pause{Read-Host 'You have successfully synced your C4D Annotations to Evernote using gnsync.
Please press Enter to continue...' | Out-Null}
Pause{}
It seems (for whatever reason) your $PATH is not being read or honored by the process; and thus python cannot be found.
You can either:
Set up the path with $env:Path = "C:\Python27:C:\Python27\Scripts";
Setup the path using a custom console profile (ie, a .ps1 file) and passing it with -PSConsoleFile.
The simplest option, pass the full path to the Python executable in your command file C:\Python27\python.exe gsync.py ...
I would try #3, and then see if you need the other options.
Adjust the paths as appropriate - especially if you have multiple Python interpreters installed.