Getting an error while creating a briefcase on BeeWare - python-3.x

The WIX environment variable does not point to an install of the WiX Toolset.
Current value: WindowsPath('.')

While creating briefcase in BeeWare, you should have admin access because it downloads and install packages.
This issue is coming because briefcase is unable to download Wix Toolset and unable to point out Wix environment variable.
You can manually download Wix Toolset from here https://wixtoolset.org/releases/
install it and check your environment variables in system variables you can find Wix.
Now try to create briefcase after installation.

Close the terminal you're working on.
Install WIX toolkit form https://wixtoolset.org/
Install via GUI installer.
Make sure it has been added to your system variable path. (refer picture below)
Run briefcase create.
Hope this helps :)

Related

Cannot launch python via cmd

Currently I'm working on a project to deliver apps via MSIX packaging including python as one of them. I've already created an msix package for the same with below settings :
So the MSIX package displays the environment variables added to the system path
VHD has been mounted (staged) and registered on test machine, however I still cannot open python via cmd
I'm a bit new to the MSIX packaging tech, so any help would be appreciated.
Users to be able to run python from cmd.
Files that are packaged and deployed with an MSIX run inside a container. This means that these files will not be "visible" by default to tools like cmd or Powershell.
You need to define an appExecutionAlias in your package manifest. The following SO question has more details:
How to run an MSIX installed application from the command line
If you're using the MSIX Packaging Tool or Visual Studio to build the package, you need to manually edit the AppXManifest.xml file and add the appExecutionAlias element.
If you're using other commercial tools, you probably have a GUI option to include and configure it.

How do I add a virtual environment to Visual Studio 2019?

I have upgraded from Visual Studio 2017 to 2019 (Community Edition). I also have installed the 'Python development' workload from the Visual Studio 2019 installer.
To add a virtual environment to a Python Project in Visual Studio, I right-click 'Python Environments' within the Python project (in the Solution Explorer View) and choose 'Add Environment...'. I opt for 'Virtual Environment', receiving the message:
"You will need to install a Python Interpreter before creating a virtual environment."
I have installed both the Anaconda 2019.03 and Python 3.7 interpreter, and I have access to both of them in Visual Studio.
The following steps worked for setting VS2019 with Anaconda3 already installed.
In the search bar, search for Add Environment, this brings up the VS Installer. Click the Python tab and you'll see a list of items that can be installed. There should only be a couple of them checked... it is unnecessary to install Python again.
When the Installer completes, open VS2019 and open Options from the Debug menu. If you aren't sure about where to show the "conda" executable path, the easiest way is to go to your "c:\user<usrname>\Anaconda3\Scripts\conda.exe" and select that. If you have already set it in your "Windows Advanced System settings" (yes, this is for Windows... there is probably a similar methodology for Linux) then check your environment variables for the path you've indicated in your environment for Conda.exe. (My choice was to forego the path and use only the IDE.)
Assuming you have Anaconda Navigator, and assuming it is open on Environments (left side), you can create a new environment called venv and it will create a Python environment for VS2019. You may need to activate it with a DOS prompt
conda activate venv
When you set it, VS2019 will spin for a bit while it configures you Python Environment in Visual Studio.
The environment choice in Anaconda3 is known as "base". Visual Studio, without Anaconda, sets up an environment called "venv". You should be able to open the Anaconda Navigator and locate your environment there. Because the venv is a separate environment, updating the base environment to use new tools should not affect VS2019. If nothing else, you can check requirements.txt to see which version is associated with the environment although it is easier to check in the Navigator.
There are some advantages to using VS2019 if you have the Git configured. It will channel your work to your default git location.
The VS2019 configuration will take some time. The time it takes to setup Pycharm setup takes less time but you may find having the environment available in VS2019 worthwhile. I found it kept spinning until I restarted. When I restarted, there were a few additional steps.
Create a Python project - name and create it. In the Solution Explorer (right by default), you'll see a listing for Python Environment. If you created the venv environment in the above step, there will be a clean "venv" environment with only about a dozen python items to choose from. This is a clean environment and easier to control. It will exist side by side in the c:\user<usrname>\Anaconda3\envs folder with your "base" environment. You can tailor your requirements from there. If your project requires new packages, one of the default items is pip.
https://learn.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-05-installing-packages?view=vs-2022
From here there is a link to an interactive demo on adding packages: https://learn.microsoft.com/en-us/visualstudio/python/media/environments/install-python-packages-2022.gif?view=vs-2017&viewFallbackFrom=vs-2022
Code below is one way to move files into SQL Server
import sys
import csv
import pandas as pd
import pyodbc
from sqlalchemy import create_engine
import urllib
import matplotlib.pyplot as plt
dtype=np.int64
data1 = pd.read_csv (r'D:\Jsonfile.csv', sep=',', engine='python', encoding = "utf-16")
df2 = pd.DataFrame(data1)
params = urllib.parse.quote_plus("DRIVER={SQL Server};SERVER=MyServer;DATABASE=MyDatabase;Trusted_Connection=yes;")
conn_str = 'mssql+pyodbc:///?odbc_connect={}'.format(params)
engine = create_engine(conn_str)
# create the table
df2.to_sql("Jsonfile", engine)
To make this work on a clean environment you need to add sqlalchemy and a few more. When you type in the sqlalchemy under the PyPI, the top command will be: "Run command: pip install sqlalchemy" which is the correct item to click.
You may want to make note that the preferred method of working with Python is to use Visual Studio Code and the setup is well documented here
How can I set up a virtual environment for Python in Visual Studio Code?
Probably you have found some sort of solution by now.
However I got the virtual environments dialog working after repairing the Visual Studio 2019 installation.
You can repair a Visual Studio 2019 installation running the Visual Studio installer and choosing the repair command from the more button (as shown in the figure below).
This is the breadcrumb that I followed:
Tools > Python > Python Environments > Add Environmemt
Add Environment... is at the top of the panel that opens when you get to > Python Environments
You can also use the 'chord' [<Ctrl> K , <Ctrl> '] to open the 'Python Environments' Panel

Web Platform Installer: Python Installer - Downloaded file failed signature verification and may have been tampered with

I'm trying to install WFastCGI 2.1 Gateway for IIS and Python 3.4 via the Web Platform Installer in Microsoft Server Manager's IIS Manager.
Python Installer fails with the error: "This product did not install successfully: Downloaded file failed signature verification and may have been tampered with". Python 3.4.2 (32-bit) and WFastCGI 2.1 Gateway for IIS and Python 3.4 subsequently fail with the error: "This product cannot be installed because a product that it depends on did not install successfully".
I noticed that the direct download link in the prerequisites tab launches this URL, which explains that pytools has been migrated to PTVS. Maybe this is part of the problem?
I'm following this tutorial about deploying a Flask web app on IIS. Please help me find solutions to make this installation successful or provide alternatives that will allow me to deploy on IIS. Thank you!
I had the exact same issue, and as mgrollins mentioned on his comment, using wfastcgi directly is the solution.
In my case I followed a very similar tutorial (here) up to where you finish installing IIS, then instead of installing the Web Platform Installer, I downloaded Python from python.org, installed it (for all users and adding to PATH), performed the "Downloading Package" and "Enabling wfastcgi" steps from the wfastcgi project page, https://pypi.org/project/wfastcgi/, meaning:
pip install wfastcgi
wfastcgi-enable
After that you can continue following the tutorial from where it says "Setup your site - copy the wfastcgi.py " . (I found the wfastcgi.py file on the Scripts folder of the Python Install directory)
Another item worth mentioning, during “Add Module Mapping” there should be a | between the Python.exe and your site directory, if you miss it the side won't load, so for example it should look like:
C:\Program Files\Python36\python.exe|C:\inetpub\wwwroot\mysite\wfastcgi.py

Load Runner set-up error

I downloaded HP Load-runner 12 Community Edition Additional Components. I tried to install but after extracting files to the temp folder then simply installation is closed. I didn't get the pop up to select the "LoadRunner full setup" please help for installing the LoadRunner in my system
http://www8.hp.com/in/en/software-solutions/loadrunner-load-testing/try-now.html
This is the proper place to download HP loadrunner latest version, Enter your correct details and after downloading take by default path of program files. I am sure it won't create any problem.
Sign in as Administrator to have the necessary rights for installation

Did I break phonegap when adjusting environment variables on Windows 7?

Installed node.js
Installed phonegap: npm install -g phonegap
Created the example app: phonegap create hello com.example.hello HelloWorld
Used the run command to test in Android: phonegap run android
What happened next is it didn't detect the Android SDK, so it asked me for build.phonegap.com account. I went ahead and created an account and entered user/pw and like magic, it created the app in the cloud. I pointed my qr code scanner to the screen and it installed on my Android phone. Cool, but...
I wanted to develop locally using the Android emulator. So I followed the instructions (http://docs.phonegap.com/en/3.0.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide) to install Android SDK, change PATH variables, etc.
When I went back to command line and cd to my phonegap root folder, suddenly "'phonegap' is not recognized as an internal or external command...'. I tried to reinstall phonegap with npm and it looks like it installs just fine again, but even when restarting cmd.exe, phonegap commands do not work.
Any ideas? Changing environment variables shouldn't affect phonegap already installed, right? The only other thing I can think is I had to install Ant and made an ANT_HOME system variable..
Apologies for the noob question. I'm sure I'm just messed up something simple here..
Figured this out. I accidentally DELETED the environment variables for node.js when I was trying to APPEND additional environment variables manually for android sdk & Ant. Since phonegap was installed as a node package, it wasn't recognized.
Better reinstall using the Msysgit and give the correct path. In my case envi variable path is as follows,
C:\Program Files\nodejs\; ->NodeJS path
F:\windows_adt\sdk\platform-tools; ->SDK Platform Tools
F:\windows_adt\sdk\tools; ->SDK Tools
C:\msysgit\bin; ->Bin Folder
C:\msysgit\git; ->git
C:\msysgit\libexec\git-core; ->git-core, if you want.
To reduce further errors use the recommended msysgit shell.

Resources