How do I get node-waf to install? - python

First, props to whoever did node.js. I've been using it for less than a day and I'm already thinking about using it for stuff I use Python for now.
In fact, whoever did node.js should think about using it for stuff they use Python for now. There is apparently a tool called node-waf that is in Python and is necessary for npm to work and npm of course is necessary for anything else useful.
I think that my original install went bad because node-waf (which is in /mnt/michael/bin/node-waf) couldn't find Scripting.py (which is in /mnt/michael/node/tools/wafadmin/; it was looking in non-existent /mnt/michael/node/tools/../lib/node/wafadmin/). So I hacked node-waf to point to the right director and kept going and found a much more serious problem.
Turns out node-waf isn't written in "Python", but in Python2.6, which is a perfectly good language, it's the language I use myself, but it isn't the language that the default on the system I use. The system is CentOS, which requires Python2.4 be the Python that the command "python" invokes. Yes, that's foolish on the part of the CentOS people but less foolish than the same mistake on the part of the node-waf people, since they are necessarily subject to the rules of the OS.
So, please tell me there's some switch I haven't found yet that say "Use Python2.6". Also, any hints about a proper install would be appreciated.

To solve the path problem, I backed up and re-installed Node. To solve the version problem, at the suggestion of some bright soul on the #nodejs channel, I created a symbolic link at ~/bin/python that pointed to the right version (that solved a lot of my own problems too, starting up the wrong version from the command line...) An obvious hack, but when you're frustrated, you overlook the obvious.

Related

Patching Linux systems with python modules installed via pip

There probably isn't one "right answer" to this question. I'm interested in thoughts and opinions.
We have a couple hundred RHEL7/Centos7/Rocky8 nodes. Many of them have python modules installed via pip/pip3.
I've been searching for a best practices on routine/monthly patching these modules...so I far haven't found any. Obviously things installed with rpm/yum/dnf are pretty easy to deal with.
From the pip man page:
pip install --upgrade SomePackage
Great!
But how do you update all of them?
Sure. It is possible to do a "pip list/freeze" pipe that to awk...etc..
Surely, there's a better way. Ideally, one that captures things like "boto3 V1.2 replaced with boto3 V1.3"
Right now it feels like I'm the only one thinking about this. Maybe I am and it is stupid. I'm ok with that response as well (but please tell me why).
A common solution is to deploy the application code inside a Docker container - the container image contains its own version of Python and all the dependency modules, so you don't have to update each module on all the host machines individually. It also means that the combination of OS, Python and modules that you deploy can be tested and then "frozen" into an immutable image which is then deployed the same everywhere.
Right now it feels like I'm the only one thinking about this.
I realise the above answer is probably not helpful in your situation as you already have a fairly large system deployed... but it might help to explain why not many people are developing solutions to your problem!

VS Code is unable to locate python

I have been looking at similar problems and everyone has a promising solution which usually revolves around changing the interpreter path. I have done my best but have run out of solutions that I can think of. I'm hoping someone else knows how and thank you for any comments.
No version of python ever appears, I have tried to enter the path in the box at the top but have had no luck
I want to switch from 3.10 to 3.9 and this is when not being able to select the version of python became a problem. The picture above is from the terminal within VS Code
This is the default path I have entered in VS Code
The photo above is from the Windows command prompt, locating the active version of python
I would like to be able to use Python 3.10 in some folders and 3.9 in others, however at the moment I really just need VS Code to see 3.9, I imagine once I know what has gone wrong at this stage it will be smooth sailing from here.
I have already uninstalled and reinstalled pretty much anything I can think could be related
I really hope I have just made a stupid mistake somewhere and it is really obvious, thank you again

emacs-ipython-notebook and SCIMAX

I was wondering what is best from these two enablers of interactive python or iPython. Either using emacs-ipython-notebook or SCIMAX. I understand that both accomplish quite the same thing, but can't decide which one to use and have no time to start checking. So if someone has checked already, much appreciated. Thanks.
Scimax is a complete emacs distro. Meaning a complete Emacs environment, a complete setup. If that is what you are after, it is well maintained by jkitchin in: https://github.com/jkitchin/scimax
EIN (Emacs ipython Notebook) maintained here, Is a notebook solution. little configuration is required. It is a package like any Emacs package.
org-babel Worth mentioning too, look for ob-python or ob-ipython, if you are using org it is a natural way to include code the literate way. It is what I ended up using . Have a look at:
https://github.com/gregsexton/ob-ipython
And also at:
https://orgmode.org/worg/org-contrib/babel/intro.html

Tablesnap not working

I'm trying to use tablesnap to make backups but without success. I'm using Ubuntu 12.04 and after trying the installation of tablesnap as it is described in github, I'm not able to do it. I guess this is due to fact that the package is for Maverick, so I have tried to copy the code and execute it but again without success. It always display the message "INFO Starting up" and seems nothing happen.
I'm sure the problem is my ignorance but, could you help me? Do you know about any document or example of installing and using for backup and recovery?
UPDATE:
The problem was me. Tablesnap was working but there was no IN_MOVED_TO event. So, now, what I'm trying to do is to backup a complete keyspace. I have tried with the "-B" option of tablesnap but still nothing is uploaded to S3. Any idea?
I'm sure the problem is my ignorance of linux, python and cassandra, but I haven't found enough information to make it work or a step by step document
Being blunt here: yes. You've got the answer to your own question. It's complicated to get used to all of that at once, but a step-by-step document won't help you a bit. Really. You need to be familiar with what you're doing, or else you won't be able to do something useful.
To compare: Installing cassandra is like buying a dentist's chair. Even with a very precise step-by-step information on how to set it up and how to place a patient on it, you'll be a terrible terrible threat to your patient's teeth if you have no education as a dentist before.
Cassandra is a mighty tool for large, ditributed systems. Someone who develops for that or even just administrates that needs to have very solid understanding of how to work with his computer in the environment that cassandra runs in. Get yourself used to linux. Then read a lot about cassandra. Then that project is on your level, and you will have success!
Ok, what I was looking for is very easy. Here is what I have done to make a complete backup of my keyspaces:
python tablesnap -k MY_AWS_KEY -s MY_AWS_SECRET -B my_s3_bucket /opt/cassandra/data/my_keyspace/*
Just replace /opt/cassandra/data/ with the path to your keyspace and that's all. As simple as this is what I was asking for, so I leave it here in case someone finds it useful.

Powershell, Python 2.7, virtualenvwrapper not finding virtualenv in PATH. Too dumb to discern answer from prev posts and Google. Please advise.

I have installed virtualenv and the virtualenvwrapper in Powershell for Python 2.7. I am following the tutorial from Tyler Butler listed here
http://www.tylerbutler.com/2012/05/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/
This is a great tutorial and I have been successful on everything so far after some Google-Fu here and there.
When I attempt to make a new virtualenv by entering:
New-VirtualEnvironment engineer
I get an error which reads:
virtualenvwrapper could not find virtualenv in your PATH
I have noticed there a number of SO posts pertaining to this question and some of them have been informative but nothing has illustrated to me the mistake I am making.
I am a beginner programmer, as you can probably tell.
Steps I have taken:
added virtualenv to my directory path...and that did nothing.
I have looked around in the virtualenv and virtualenvwrapper files for some sort of helpful .txt file but again while informative I could not seem to glean an actual solution.
Any input is appreciated, Please and Thank You for stopping by to read this!
I've just moved from my laptop to a new PC and am having trouble setting up my environment - I can't seem to find the docs I used initially.
That being said, this might help (though it's not the way my initial setup worked):
Set up a powershell profile
Add "Import-Module virtualenvwrapper" (without quotation marks) to your profile.
As to setting up a profile, there should be documentation floating around. Mine is set up with "posh-git", since I was looking to add git functionality. If you're interested in that, read this: http://jdhnet.wordpress.com/2014/01/10/a-better-git-commandline-by-integrating-git-with-powershell/
However, I'm not sure this addresses your particular error, so do reply if it doesn't work - it might be that you're not adding to the path correctly.
Hope that helps! I'll probably edit it later once I have time to read up on .profiles, but this should suffice! Have fun.

Categories

Resources