Debian Programming :: Virtualenv - How To Default To Python3
May 16, 2015
I have a few questions regarding virtualenv and virtualenvwrappers. The following packages are available, I am currently using python3 for my project. However I would like have the option to use either 2.7 or 3.x for my virtual environments.
Given this do I install both python-virtualenv and python3-virtualenv? What is that third package all about, does virtualenv support both versions by chance? I chose to install both python-virtualenv, and python3-virtualenv (not sure if both were actually needed). These packages where installed via apt-get.
So far so good, "virtualenv test" creates a python2 env, and "virtualenv --python=/usr/bin/python3 test2" creates a python3 environment.
After installing virutalenvwrapper (also installed with apt-get) is where I hit the problem. In an attempt to default ot python3 I added the following to my .bashrc file.
Sourcing the .bashrc file cases the following error. What am I missing here?
/usr/bin/python3: Error while finding spec for 'virtualenvwrapper.hook_loader' (<class 'ImportError'>: No module named 'virtualenvwrapper')
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 and that PATH is set properly.
Further searching found a post on stackoverflow which led me to change the .bashrc to the three lines below. After this change it all works!!!
I get an error when trying to install python-virtualenv package:
Quote: # yum install python-virtualenv Loaded plugins: presto, refresh-packagekit Setting up Install Process Resolving Dependencies --> Running transaction check
[Code]...
AFAIK, python-virtualenv package does not really require any development packages (at least in ubuntu, debian, opensuse). Is it a bug? I didn't find anything with search engines...
I am trying to install pygame(from source) for python3 on my openSUSE 11.3. From repos pygame is only available for python2 and not for python 3. While running the installation scripts I am getting this:
Code: linux-eeow:/home/vivek/Projects/codes/python/pygame-1.9.1release # python3 setup.py No Arguments Given, Perform Default Install? [Y/n]Y WARNING, No "Setup" File Exists, Running "config.py" Using UNIX configuration...
Hunting dependencies... SDL : found 1.2.14 FONT : not found IMAGE : not found MIXER : not found SMPEG : found 0.4.5 PNG : found JPEG : found SCRAP : found PORTMIDI: not found PORTTIME: not found
Warning, some of the pygame dependencies were not found. Pygame can still compile and install, but games that depend on those missing dependencies will not run. Would you like to continue the configuration? [Y/n]: What these dependencies are. What all do I need to install...
error: /usr/local/lib/python3.2/dist-packages/athletelist-1.0.0.egg-info: Permission denied m?PS. I use Ubuntu 11.04 and I am quiet new on Linux World.
I have kind of a weird question. All Slackbuilds use -march=i486 -mtune=i686 -O2 to pass to gcc for standard building. What does gcc use by default if none are specified. Say for instance I just did ./configure && make && make install without specifying -march.
I have rtl8187se linux driver, during installation in debian linux it tells that "the kernel is not a generic". How can i install this driver in default debian kernel (without generic)?
My code needs to link to some libraries. In my project file, I specify linker to link to abc library, for example. By default, does gcc link to libabc.a or libabc.so ? What if I really need to specify static or shared, how do I do that?
This is a really specific question, but maybe someone can help. I'm debugging someone else's code, and they call a UDPWriter and specify an IP address and port, and I'm trying to make sure this multicast traffic goes over a certain port. How can I determine which port the UDP defaults to and change it?
It's confusing to me because I'm not familiar with all the layers the OS sends traffic through before it goes through the interface. Is there maybe some simpler way to tell the OS to send multicast traffic over both interfaces?
I would like to create perl script that take the default value instead of waiting for me to enter the enter. I have running script that make key for vpn and when I run the script it will start creating key and then ask me questions like what is your country[:us] what is your state name[:nj] ......
so every time I just have to enter cause I need to enter only default values. So is there any way that I can create script that just take me directly to the end without waiting for me to enter anything and taking by default values.
I would like, from a C program, find the hardware MAC address of the default route path. With BASH I can do a 'route' find 'default and then an ifconfig and grep for 'HWaddr'. Are there C calls to do the same??
I have the first part of this script working, but I need help on how to specify a different port other than the default 22 for one particular server in my hostlist. First, here's my working script:
[code]....
Now, the hostlist contains a few servers that all share the same password in this test so as not to complicate that portion of expect's password section. However, one of the servers within hostlist_test will need to have the ssh port defined as, for example, 5522 as I've defined the port forward in DD-WRT's NAT section and changed in the appropriate /etc/ssh/sshd_config for listening. Might anyone be able to help me include that part in my script?
The title of this post may sound like it's real easy and simple enough for a noob to do but my situation isn't noobish.I have this script that i found on the internet that i wish to edit and create a new user and set a pass word AND create a default web page in the /var/www/html directory. This is the script with my edits included. The commented out field are my own editing.....
Code: #!/bin/bash # Script to add a user to Linux system if [ $(id -u) -eq 0 ]; then
Code: #!/bin/bash echo -n "Please insert your name: " read NAME
[Code]....
It works fine, but is it possible to have default values using bash read(1b)? I mean if user is prompter for sex, he just pushes ENTER and by default 'm' is chosen. Or if user is prompted for hometown and he doesn't insert anything, but just pushes ENTER button, 'New-York' sis chosen by default Are such default values possible in bash?
I am looking for a way to delete the systems default gateway from the routing table via the NETLINK API.Unfortunately, the documentation I found about NETLINK is incomplete.There are some basics (communicating with the kernel, reading the routing table) but not much more.Does anyone know the packet format for deleting a routing table entry, especially deleting the default gateway? I can set or change the default gateway with the following parameters (there are more, but I left out all the non-essential ones):
I am developing a application in which i have to show the name of default browser and mail client. i want to run this application on RedHat, SuSE, Mandriva, and Ubuntu. I have checked similar threads but not found any useful information.
// create a filechooser; JFileChooser chooser = new JFileChooser(cwd); FileNameExtensionFilter filter = new FileNameExtensionFilter( "sdf files (*.sdf)", "sdf");
[code]....
This will give 3 filefilters ('all files', 'sdf files' and 'xml files') for a fileopen dialog. Exactly as I want (in alphanumerical order), but XML is the default extension and I like SDF to be the default extension. Research has not revealed solutions; the setFileFilter method sets the primary filter. If I swap the sequence in the code, SDF becomes the default (as I want) but the sequence is wrong (All, XML, SDF).
I came across this script a while back that i found. What i want to do is edit the script to create a default web page in /var/www/html a new user is added through the script.What the script does now is adds a user and sets a password for the user. What possible way (either through a combination of python or c or some other language) could i add to the shell script to do this? I've tried just dointhe command to touch index.html /var/www/html but it puts it on the desktop. Here's the script....
Code: #!/bin/bash # Script to add a user to Linux system
I wanted to know how can I change the default place of shared object files of a program in a system. let me explain it better for you : I have an embedded computer with Linux OS that its file system is read only and I can not add any file to /usr /lib and ..... and I can just mount a SD memory card to it and copy all of my programs to it and run them from there as you understand I have two choices to choose, first make one big binary file for each program that I am doing it now and it is not a suitable solution and the second is finding the way to change default place of shared object file of my program.
i've gotten my fedora 12 to the point where i can run python3 scripts from command line and can call up python 2.6.2 idle with the command 'idle' from command line. what command will call up python3 (3.1.2 to be exact) idle?
As you can see we have a problem. If we use a wchar_t instead the string wont be formatted right we need to prefix L in front. If we use char16_t we need to prefix a u in front. Is there a was to make the generic without resorting the the std::string class?
I'm studying an OS programming book, in particular network sockets. I have two questions(2nd one is down at the bottom). There is something I don't quite understand. What if this piece of code, which sets sigpipe's default action to ignore and opens a socket:
I recently installed SLiM and wanted to give it a try. I found out that XDM actually loads a bit faster on my machine, so I'm going to stick with it. I uninstalled SLiM, leaving XDM the only login manager on my system, but how can I change it back to the default? When my system boots up, I get the default console login.
I'd like to know if there's a reliable way to change the default user in Debian: when I installed testing starting from Jessie, I used rsync to set up a duplicate stable installation and then upgraded it to testing, as a result I now have the same username for both installations, which is sometimes kinda confusing.
Reading around a bit, looks like you can indeed change your username with relative ease, but then there will be always something left behind somewhere still pointing at the old username: is that the case?
I have three pc's in the house, one desktop and three laptops. the two windows pc's (windoze 7) worked with dsl and firefox just fine. my linux debian laptop DID give me a network connection, i can log in as admin and change the router/modem ect with no prob. i cant get the default browser in debian to load a page. iceweasel says cant resolve the host name. i have WOW and secondlife installed and both games work fine. i can get a connection on the wireless and play them with no prob. I cant surf the web with any default browser in debian. i have a internet connection. i just cant surf so its got to be in the web browser settings? i looked, did not change anything, but do not see what could be causing this.
I downloaded emacs, but when I run it in terminal, it does not open the gui - it opens emacs in the terminal and I do not want that. Also, kate just doesn't launch and a bunch of error appears. What do I need to do to launch the applications on GUI by default?
Once I setup KDE on Testing and opened Dolphin I reallzed there were no default folders (Documents, Desktop, Music...) and was wondering if this is normal. Other distros like Kubuntu and PCLinuxOS (what a name) have these and I was wondering if they added them or they are part of KDE. Gnome has them on debian but not KDE. If they are part of KDE and I'm missing them and shouldn't, would manually adding them as I did require mentioning them elsewhere on the system or do applications and such assume they are there?
So when my laptop resumes from suspend (haven't tried hibernate) the screen is black (and stays black) until I hit ctrl-f7is this because its opening the wrong display, or because ctrl-f7 'wakes up' X, or ??? it's not that big of a deal, now that I know how to get back to the X session (at first I thought it was "frozen")but it is sort of inconvenient, is there a way to make the behavior "automatically go back to the x sesson on resume" ?
Currently on testing and wanted to upgrade to sid. Just wanted to confirm that sid currently does not have things like security/backports/volatile/etc. Am I correct to assume that Debian Sid's source list will looks something like this: