When I run the following command on windows visual code terminal to test my code
brownie run scripts/file.py --network kovan
I get this error
"SolcInstallationError: Downloaded binary would not execute, or returned unexpected output."
Also some errors referring to files for running the installation but so far my trouble shooting has led me to uninstall brownie then install with pipx and initialized a package.json and ran
npm install -g solc
and i still get that error whenever I run the script
Install Solc on Windows
Download the Windows binary from
https://github.com/ethereum/solidity/releases
Put the solc-windows.exe into a new folder
Rename solc-windows.exe to solc.exe
Launch a command prompt and cd into the directory where solc.exe was
extracted to
First check the version
solc --version
In your case I recommend adding it to you PATH variable:
Click Start and type system. From the search results select System
(Control Panel)
Start System
From the System window on the left click Advanced system settings
On the Advanced tab click Environmental variables
Under User variables for… select Path and click Edit
Add the path to your solc installation, then click OK, OK, and OK to
save. Close and reopen any command prompts for the change to be
reflected.
Credits: https://www.codeooze.com/blockchain/solc-hello-world/
Related
I went on the cmdl and pip install cookiecutter
This worked fine because when i do
pip show -f cookiecutter
I have the information of where it was saved(i.e: c:\users\name\appdata\roaming\python\python39\site-packages
But when I try to run the following command in the folder I want my template to be created in
cookiecutter -c v1 https://github.com/drivendata/cookiecutter-data-science
This error message is displayed:
'cookiecutter' is not recognized as an internal or external command,
operable program or batch file.
After reviewing countless other similar posts, I think this might have to do with the virtual environment or path that is active but I have no idea what that means and how to make changes in my system.
To use cookiecutter, type "python" in the Windows search bar. Your current python version should show up. In the window that pops-up, click "open file location". Right click the python shortcut icon and click "open file location" again. Look for the "Scripts" folder and double click it. If you installed cookiecutter correctly, you should see it in the "Scripts" folder.
Copy the file path and open up "System Properties". In "System Properties", click on "Environment Variables", then open up "PATH" and add the link you just copied to path. Click "OK" to all and restart the command prompt. Using the command prompt, go to the folder where you want to set up the project in your local system and run the following:
cookiecutter -c v1 https://github.com/drivendata/cookiecutter-data-science
If it works, it should ask you for project name, author name etc.
correction
i edited the environment variable to path Scripts, but in the command prompt on typing the pip command it does not shows up the package installation
python\scripts location picture
While executing the pip command in the command prompt, it shows pip is not recognized as an internal or external command, operable program or batch file.
I tried setting environment variables and all other alternative solution still I am not able to solve it. I recently noticed pip.exe file missing from python/scripts module.
Is that reason to show up this error? if it is yes, how will I install it manually?
You should add the full directory to the Scripts folder to your PATH environment variable. When you run commands in a command prompt, Windows will search through the folders listed in PATH.
Assuming you are on Windows 10:
Press the start button then search "Environment Variables"
Click the "Edit Environment Variables" option.
Click the "Environment Variables" button in the box that pops up.
Scroll down and find the PATH variable, double click it.
Click "New"
Paste in the path to the Scripts folder.
Save it and exit, then restart the terminal. Now pip will be recognized.
Finally I solved it.I used python 3.8.3 version.Not folder named "Scripts" in this version.I just delete this version and reinstall python 3.7.8 version and then pip is here :D
I know this has been solved, but another way of dealing with this is to create an empty file in the 'Scripts' folder and rename it to pip.bat. Then add the following code:
python -m pip %*
Which simply passes all the arguments of the pip command to python.
When I double-click on pycharm.sh, Ubuntu lets me choose between "Run in Terminal" and "Run". What is the difference between these options?
To make it a bit more user-friendly:
After you've unpacked it, go into the directory, and run bin/pycharm.sh.
Once it opens, it either offers you to create a desktop entry, or if it doesn't, you can ask it to do so by going to the Tools menu and selecting Create Desktop Entry...
Then close PyCharm, and in the future you can just click on the created menu entry. (or copy it onto your Desktop)
To answer the specifics between Run and Run in Terminal: It's essentially the same, but "Run in Terminal" actually opens a terminal window first and shows you console output of the program. Chances are you don't want that :)
(Unless you are trying to debug an application, you usually do not need to see the output of it.)
The question is already answered, Updating answer to add the PyCharm bin directory to $PATH var, so that pycharm editor can be opened from anywhere(path) in terminal.
Edit the bashrc file,
nano .bashrc
Add following line at the end of bashrc file
export PATH="<path-to-unpacked-pycharm-installation-directory>/bin:$PATH"
Now you can open pycharm from anywhere in terminal
pycharm.sh
For Pycharm CE 2018.3 and Ubuntu 18.04 with snap installation:
env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop /snap/bin/pycharm-community %f
I get this command from KDE desktop launch icon.
Sorry for the language but I am a Spanish developer so I have my system in Spanish.
As mentioned in the above answer, by updating the bashrc file you can run the pycharm.sh from anywhere on the linux terminal.
But if you love the icon and wants the Desktop shortcuts for the Pycharm on Ubuntu OS then follow the Below steps,
Quick way to create Pycharm launcher.
1. Start Pycharm using the pycharm.sh cmd from anywhere on the terminal or start the pycharm.sh located under bin folder of the pycharm artifact.
2. Once the Pycharm application loads, navigate to tools menu and select “Create Desktop Entry..”
3. Check the box if you want the launcher for all users.
4. If you Check the box i.e “Create entry for all users”, you will be asked for your password.
5. A message should appear informing you that it was successful.
6. Now Restart Pycharm application and you will find Pycharm in Unity dash and Application launcher.."
First, go to that folder which is containing pycharm.sh and open terminal from there. Then type
./pycharm.sh
this will open pycharm.
bin folder contains pycharm.sh file.
You can launch PyCharm from terminal using pycharm-community or pycharm-professional if installed via snap. See here for more details: Location of PyCharm after install PyCharm as snap package
Yes just go to terminal
cd Downloads
ls
cd pycharm-community-2021.2.2 (your pycharm version)
ls
cd bin
ls
./pycharm.sh
It will open your continued pycharm project
I did the edit and added the PATH for my Pycharm in .bashrc but I was still getting the error "pycharm.sh: command not found".
After trying several other things the following command resolved the issue which creates a symbolic link.
sudo ln -s /snap/pycharm-community/267/bin/pycharm.sh /usr/local/bin/pycharm
The first is location to the exact path to pycharm.sh and the second is user bin which should be on PATH env by default
Official docs says if you have installed pycharm at this location: /opt/pycharm/bin/pycharm.sh then you can make it callable from terminal by using this command:
ln -s /opt/pycharm/bin/pycharm.sh /usr/local/bin/pycharm
I have a project to do for after create a webpage that display the latest weather from my CSV file.
I would like some details how to do it (don't really get the http://flask.pocoo.org/docs/installation/#installation installation setup)
Can anyone mind explain me how to do it simply?
Thanks.
I'm running on Windows 7, with the Windows Powershell.
Install pip as described here: How do I install pip on Windows?
Then do
pip install flask
That installation tutorial is a bit misleading, it refers to actually running it in a production environment.
First install flask using pip,
pip install Flask
* If pip is not installed then install pip
Then copy below program (hello.py)
from flask import Flask
app = Flask(__name__)
#app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
Now, run the program
python hello.py
Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Just copy paste the above address line in your browser.
Reference: http://flask.pocoo.org/
Assuming you are a PyCharm User, its pretty easy to install Flask
This will help users without shell pip access also.
Open Settings(Ctrl+Alt+s) >>
Goto Project Interpreter>>
Double click pip>> Search for flask
Select and click Install Package ( Check Install to site users if intending to use Flask for this project alone
Done!!!
Cases in which flask is not shown in pip:
Open Manage Repository>>
Add(+) >> Add this following url
https://www.palletsprojects.com/p/flask/
Now back to pip, it will show related packages of flask,
select flask>>
install package>>
Voila!!!
https://www.youtube.com/watch?v=QjtW-wnXlUY&t=38s
Follow as in the url
This is how i do :
1) create an app.py in Sublime Text or Pycharm, or whatever the ide, and in that app.py have this code
from flask import Flask
app = Flask(__name__)
#app.route('/')
def helloWorld():
return'<h1>Hello!</h1>'
This is a very basic program to printout a hello , to test flask is working.I would advise to create app.py in a new folder, then locate where the folder is on command prompt
enter image description here
type in these line of codes on command prompt
>py -m venv env
>env\Scripts\activate
>pip install flask
Then
>set FLASK_APP=app.py
>flask run
Then press enter all will work
The name of my file is app.py, give the relevant name as per your file in code line
set FLASK_APP=app.py
Also if your python path is not set, in windows python is in AppData folder its hidden, so first have to view it and set the correct path under environment variables. This is how you reach environment variables
Control panel ->> system and security ->> system ->> advanced system setting
Then in system properties you get environment variables
On Windows, installation of easy_install is a little bit trickier, but still quite easy. The easiest way to do it is to download the distribute_setup.py file and run it. The easiest way to run the file is to open your downloads folder and double-click on the file.
Next, add the easy_install command and other Python scripts to the command search path, by adding your Python installation’s Scripts folder to the PATH environment variable. To do that, right-click on the “Computer” icon on the Desktop or in the Start menu, and choose “Properties”. Then click on “Advanced System settings” (in Windows XP, click on the “Advanced” tab instead). Then click on the “Environment variables” button. Finally, double-click on the “Path” variable in the “System variables” section, and add the path of your Python interpreter’s Scripts folder. Be sure to delimit it from existing values with a semicolon. Assuming you are using Python 2.7 on the default path, add the following value:
;C:\Python27\Scripts
And you are done! To check that it worked, open the Command Prompt and execute easy_install. If you have User Account Control enabled on Windows Vista or Windows 7, it should prompt you for administrator privileges.
Now that you have easy_install, you can use it to install pip:
easy_install pip
First: I assumed you already have Python 2.7 or 3.4 installed.
1: In the Control Panel, open the System option (alternately, you can right-click on My Computer and select Properties). Select the “Advanced system settings” link.
In the System Properties dialog, click “Environment Variables”.
In the Environment Variables dialog, click the New button underneath the “System variables” section.
if someone is there that above is not working, then kindly append to your PATH with the C:\Python27 then it should surely work. C:\Python27\Scripts
Run this command (Windows cmd terminal): pip install virtualenv
If you already have pip, you can upgrade them by running:
pip install --upgrade pip setuptools
Create your project. Then, run virtualenv flask
heres a step by step procedure (assuming you've already installed python):
first install chocolatey:
open terminal (Run as Administrator) and type in the command line:
C:/> #powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
it will take some time to get chocolatey installed on your machine. sit back n relax...
now install pip. type in terminal
cinst easy.install pip
now type in terminal:
pip install flask
YOU'RE DONE !!!
Tested on Win 8.1 with Python 2.7
I have windows 10 and pythonv3.5. #uku answer is correct. however, problem I was facing is that where are python scripts which are to be added in environment variable. So I found out that we need to add
C:\Users\\AppData\Local\Programs\Python\Python35\Scripts
above location as environment variable. If it still doesnot work search for python in C Drive then find out script locations.
If You are using windows then go to python installation path like.
D:\Python37\Scripts>pip install Flask
it take some movement to download the package.
you are a PyCharm User, its good easy to install Flask
First open the pycharm press
Open Settings(Ctrl+Alt+s)
Goto Project Interpreter
Double click pip>>
search bar (top of page) you search the flask and click install package
such Cases in which flask is not shown in pip: Open Manage Repository>> Add(+) >> Add this following url
https://www.palletsprojects.com/p/flask/
Now back to pip, it will show related packages of flask,
select flask>>
install package
I have Windows 7 (64-bit) operating system. I have installed python. I want to install setuptools (for python).
In their website (https://pypi.python.org/pypi/setuptools) it is written: "Download ez_setup.py and run it;"
I download that file, save it to my hard drive. Then when I click (right mouse button) and select "Open with"-> "python", a black console screen appears for a second, then disappears. And that's all.
What is wrong and how can I install that software?
Open a command prompt (Start menu -> cmd.exe)
Navigate to the directory where ez_setup.py is saved, e.g.:
cd C:\Users\You\Downloads
Run it (C:\Python27\ should already be on your %PATH%; if it's not, add it -- see below):
python ez_setup.py
Read the output. If it worked, you should be able to install packages like so:
C:\Python27\Scripts\easy_install jinja2
Add the path to easy_install to your %PATH% so that you can use it easily from any directory:
Control Panel -> System -> Advanced system settings
Click the Environment variables... button
Edit PATH and append ;C:\Python27\Scripts\ to the end (substitute your Python version)
Click OK. Note that changes to the PATH are only reflected in command prompts opened after the change took place.
If something goes wrong, the command prompt will remain open after the program finishes, so you'll be able to read the error and use it to resolve the problem.