Install cassandra 3.10 on windows 10 - python

I am trying to install Cassandra on windows 10 localhost.
I am getting error as Can't detect Python version!
I am trying this way
Downloaded and extracted Cassandra in C:\wamp64\apache-cassandra-3.10
Set Set-ExecutionPolicy Unrestricted in Windows powershell
From Windows CMD
cd C:\wamp64\apache-cassandra-3.10\bin
C:\wamp64\apache-cassandra-3.10\bin>cassandra.bat -f
Cassandra is now running so I stopped it by Control-C
Then I try to run cqlsh by following command
C:\wamp64\apache-cassandra-3.10\bin>cqlsh.bat
But I got errror Can't detect Python version!
So I download and install Python 2.7.13 in C:\wamp64\python
I have added environmental path for python in System Properties C:\wamp64\python\
I extracted Thrift in C:\wamp64\python\thrift-0.10.0
Then I install Python like this
C:\wamp64\python\thrift-0.10.0>python setup.py install
But again I am getting error on running cqlsh as
C:\wamp64\apache-cassandra-3.10\bin>cqlsh.bat
Can't detect Python version!
Please see and suggest what step I have missed in installation of Cassandra for this error.
Thanks
Edit
I reinstall everything from scratch again carefully and now I am getting this error
C:\wamp64\apache-cassandra-3.10\pylib>python setup.py install
Traceback (most recent call last):
File "setup.py", line 33, in <module>
ext_modules=get_extensions(),
File "setup.py", line 26, in get_extensions
from Cython.Build import cythonize
ImportError: No module named Cython.Build
C:\wamp64\apache-cassandra-3.10\pylib>cd C:\wamp64\apache-cassandra-3.10\bin
C:\wamp64\apache-cassandra-3.10\bin>python cqlsh localhost 9160
File "cqlsh", line 20
python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 0x03000000))' 2>/dev/null \
^
SyntaxError: invalid syntax
C:\wamp64\apache-cassandra-3.10\bin>
Please see and suggest any possible way to resolve these error.
Thanks

I have installed latest version of Apache Cassandra 3.11.9 for Windows, My python env variable is already set for python3 (Python 3.8), as I actively use python 3.8. I was continuously getting error, then I installed python2 inside 'Apache Cassandra 3.11.9\bin'. I need not to reset my env variable to python2.
The more on solution:
https://susant.medium.com/simple-way-to-install-cassandra-in-windows-10-6497e93989e6

I think you are following wrong python installation procedures. please uninstall all the python instances using programs and features section in control panel. then install python obtained from python.org. ensure add to path option is checked on the time of installation. verify python installation by typing python on a CMD window.
After that cd to your cassandra installation bin folder. type cassandra.bat -f. it will successfully launch a cassandra server instance. And never stop it, beacuase cqlsh needs a running cassandra instance.
Then open another CMD window. cd to your cassandra installation bin folder. type cqlsh. it will successfully connect to running cassandra server instance. And CMD window will switched to cqlsh console mode.
Successfully tested and verified on Win 7 64 bit with python 2.7 64 bit. I you have time, please check it on python 3.6 too...

I had this issue as I was running Python3 and Python2 on Windows.
It seems like the problem was with missing PATH to Python2.
To check, run in cmd:
python --version
If you get nothing, it means that the PATH is not added.
Note:
To add path when installing Python2 you need to scroll down to Customize Python 2.x.x -> Add python.exe to Path (unlike Python 3 where you have a checkbox)

Related

Unable to move the Stable Diffusion pipeline to my M1 MacBook

I am following the steps stated here: How to use Stable Diffusion in Apple Silicon (M1/M2).
At my local MacBook M1 machine, I saved the below script in stable-diffusion.py file:
# make sure you're logged in with `huggingface-cli login`
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
pipe = pipe.to("mps")
# Recommended if your computer has < 64 GB of RAM
pipe.enable_attention_slicing()
prompt = "a photo of an astronaut riding a horse on mars"
# First-time "warmup" pass (see explanation above)
_ = pipe(prompt, num_inference_steps=1)
# Results match those from the CPU device after the warmup pass.
image = pipe(prompt).images[0]
Now when I am trying to execute: python stable-diffusion.py from Terminal, I am getting following error:
Traceback (most recent call last):
File "/Users/apple/Desktop/area_51/stable-diffusion.py", line 2, in <module>
from diffusers import StableDiffusionPipeline
ModuleNotFoundError: No module named 'diffusers'
In order to fix it even I tried: pip install diffusers, however I still got same error.
Am I missing anything over here?
If you have already installed diffusers but are still encountering the ModuleNotFoundError, it's possible that the module is installed in a different Python environment than the one you are running your script from. In that case, you may need to check your Python environment settings and ensure that the module is installed in the correct environment.
To check your Python environment settings, you can use the following steps:
First, determine which Python interpreter you are currently using by running the following command in your terminal:
which python3
This should output the path to the Python interpreter that is currently being used. (I assume you're using python3. If you are using python2 for some ungodly reason, you should switch to python3.)
Next, ensure that the diffusers package is installed in the environment associated with the Python interpreter you are using. You can do this by running the following command:
python3 -m site
This will output information about the Python installation, including the location of the site-packages directory where installed packages are stored.
Look for a line that says "sys.path" or "USER_SITE" to find the location of the site-packages directory. This is the directory where Python looks for installed packages.
Check if the diffusers package is installed in the site-packages directory. You can do this by looking for a directory called diffusers inside the site-packages directory.
For example, if the site-packages directory is located at /usr/local/lib/python3.9/site-packages, you can check for the diffusers package by running the following command:
ls /usr/local/lib/python3.9/site-packages | grep diffusers
If the diffusers package is installed, this command should output a directory called diffusers. If the package is not installed, the command will not output anything.
If the diffusers package is not installed in the correct environment, you can try installing it using the appropriate package manager for that environment. For example, if you are using a conda environment, you can try installing the package using conda (conda install -c conda-forge diffusers). If you are using a virtual environment created with venv, you can try activating the environment and installing the package using pip (pip3 install diffusers).

python3 -m venv .venv Error: [WinError 2]

As the title shows, I get an error when attempting to run python3 -m venv .venv: Error: [WinError 2] The system cannot find the file specified. I am running the command in Bash on Windows. I have python version 3.8.7.
I tried copying "python.exe" to also have "python3.exe" which may be worth noting.
Python is installed here: C:\Users\me\AppData\Local\Programs\Python\Python38
Path includes: C:\Users\me\AppData\Local\Programs\Python\Python38\Scripts
and C:\Users\me\AppData\Local\Programs\Python\Python38\
Any remedies to this issue, thank you all.
Since you are working with windows, you can specify python version with python absolute path as mentioned previously or with python launcher (which is installed with python) with py command.
you can list installed python versions with py -0 then you can get output similar to this:
Installed Pythons found by py Launcher for Windows
-3.9-64 *
-3.8-32
-3.7-64
-3.6-64
-2.7-64
Then you can specify python version you want by typing it as listed.
python3 command is almost used in linux os which have installed python 2.x so python refer to python 2.x and python3 refers to python 3.x.
More information i found from this answer post Link.

Getting the error "from robot import run_cli ImportError: No module named robot" even when robotframework was installed in the system using python?

While running the command pybot --version
I'm getting the error
from robot import run_cli ImportError: No module named robot
I have already installed robotframework 3.0 with python after downloading the module with its setup.py file.
I tried installing and reinstalling it multiple times.
Also I have verified the environment variables for the same which also seems to be inline with what I have installed.
I checked in the site-packages also where I am able to see robotframework 3.0 present in them.
I checked in the /usr/local/bin as well as /home/.local/bin folder I can see both robot and pybot available. But for running the command robot --version also it is showing the same error.
I really don't know what is missing.
My Environment:
Ubuntu 16.04
python 2.76
robotframework 3.0
Thanks in Advance!
I have little experience on installing the ROBOT Framework in linux machine. But just check whether you have done the following:
How did you install ROBOT Framework? Is it by pip command or with the downloaded source file? Have you tried with pip command if any?
Set python path in your environment path/variables. Example in windows, C:\Python27\
Set python scripts folder in your environment path/variables. Example in windows C:\Python27\Scripts
Last, maybe you can share the output of your 'pip list' command? So, just want to see what are the modules/packages that you have installed.

How do I solve the issue "No module name Botan"

I am using windows 8 and python 3.6.1 I've done the following command in my cmd:
pip install cryptoshop
However, when I run the following python code:
from cryptoshop import encryptfile
from cryptoshop import decryptfile
result1 = encryptfile(filename="test", passphrase="mypassphrase", algo="srp")
print(result1)
result2 = decryptfile(filename="test.cryptoshop", passphrase="mypassphrase")
print(result2)
I get the following error:
Traceback (most recent call last):
File "C:/Users/Owner/Desktop/test.py", line 1, in
from cryptoshop import encryptfile
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop__init__.py", line 26, in
from cryptoshop.cryptoshop import encryptfile
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop\cryptoshop.py", line 56, in
from ._cascade_engine import encry_decry_cascade
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop_cascade_engine.py", line 27, in
from ._nonce_engine import generate_nonce_timestamp
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop_nonce_engine.py", line 39, in
import botan
ModuleNotFoundError: No module named 'botan'
Now, I obviously know that you must install botan into python in order to use it. However, this is where I am running into an issue. I've downloaded Botan from this link as instructed:
https://github.com/randombit/botan
And then I've followed these instructions in an attempt to install Botan:
./configure.py [--prefix=/some/directory]
make
make install
However, when I type make into the command line I get an error saying there is no such command. And then when I go to run my above Python code I still get the no module Botan error. So obviously I am doing something run. How can I properly install Botan into my Python 3.6 directories so that I can use cryptoshop.
I've also attempted to do pip install Botan, as that is how I've installed so many other python libraries but that has been unsuccessful as well.
make is a linux command
According to the botan website you can use nmake as a replacement on windows ( http://wiki.c2.com/?UsingNmake ) :
On Windows
You need to have a copy of Python installed, and have both Python and
your chosen compiler in your path. Open a command shell (or the SDK
shell), and run:
$ python configure.py --cc=msvc (or --cc=gcc for MinGW) [--cpu=CPU]
$ nmake
$ botan-test.exe
$ nmake install
Botan supports the nmake replacement Jom which enables you to run
multiple build jobs in parallel.
source : https://botan.randombit.net/manual/building.html
For completeness, here's how I made it work on a Mac
Assuming you have brew installed.
brew install botan
You may need to install other functionality first:
brew install gmp
brew install mpfr
brew install mpc
Find out where botan got installed with brew info botan.
My location is /usr/local/Cellar/botan/2.6.0
In that folder, you'll find lib/python2.7/site-packages, copy the contents of this folder into your Python's installation site-packages folder.
Note 1: At the time of this writing, only python 2.7 seems to be supported, but I'm using python 3.6 and everything seems to be working.
Note 2: If the file is called botan2.py, you may need to rename it to botan.py in your python's site-packages folder.

Fatal error in launcher: Unable to create process using '"' in python

I had python 2.7 before and then I installed python 3.4.The OS is windows 10
I have renamed
C:\python27\python.exe to python2.exe (when I run python2 --version it shows correct version)
and
C:\python34\python.exe to python3.exe (when I run python3 --version it shows correct version)
I have set the path variable manually and there is no space etc.
I was trying to create a virtual environment and assign python34 to this new environment.
I was going through this SO reference -- Using VirtualEnv with multiple Python versions on windows
prompt>> virtualenv -p c:\Python34\python3.exe casenv
But I got an error--
Fatal error in launcher: Unable to create process using '"'
Do I need to install virtualenv again for python34 or somewhere I need to set virtualenv path for each python installation.
Any help is highly welcomed.
In my case, i had installed python 3.6 and uninstalled python 2.7 when i got this error.
Completely deleting the C:\Python2.7 directory did the trick.
This error is usually caused because of python directory of different versions stored at same location.
i.e in my case I was using python 3.5.X for development and when I updated to 3.7.6 I got this error.
People on internet suggest that it is because of pip but main cause is 2 or more python directory.
The following steps should fix it:
Uninstall previous python version (or use virtual environment if you want to play with multiple python version)
Delete the python directory you are not using (as it causes confusion for terminal to understand which python path it should pick to execute the command)
and this should fix the error of
fatal error in launcher unable to create process using ' '
Pip version: 10.0.0
Python version: 3.6.5 64 bit
Operating system: Windows 7 Ultimate, Service Pack 1, 64-bit
Description:
After upgrading pip to the version 10.0.0 (from Pycharm, that is using pip as a package) any attempts to start updated pip cause an error:
Fatal error in launcher: Unable to create process using '""c:\program files\python 3.6\python.exe" "C:\Program Files\Python 3.6\Scripts\pip.EXE"'
Command python -m pip works as expected.
I found text "Fatal error in launcher" only in executables:
src\pip_vendor\distlib\t32.exe
src\pip_vendor\distlib\t64.exe
and in the pip.exe itself.
After
python -m pip uninstall pip
easy_install.exe pip
error disappeared.
It is interesting, that initially pip.exe had almost the same size as t64.exe, now it significantly shorter.
If someone came after installing a newer version like 3.X and uninstalled the older version, what you need to do is to delete the old version's folder from C Drive.
Clean Fix (Windows)
The fastest way to fix the issue you were facing is to uninstall and reinstall.
Why it happened?
You probably moved the directory where python was installed.
You probably have both environmental variables listed in Environmental Variables.
Things to consider
You can only use 1 active version of python at a time if you use the MSI installer.
If you downloaded the zip file of Python, you can have unlimited versions in your computer BUT you can only have 1 active version under Environmental Variables.
You can always use any version of Python explicitly by writing the direct path to the specific location of the version of Python.

Categories