我试图告诉virtualenvwrapper使用--Declaring table with multi values
declare @idSites table
(
idSite varchar(100)
)
insert into @idSites values ('MS01')
insert into @idSites values ('MS02')
insert into @idSites values ('MS03')
--Assuming a table with columns and values added in below CTE
;with cte as (
select
-1 as MS01
,2 as MS02
,-1 as MS03
,-1 as CustomerYN
union all
Select
2 as MS01
,-1 as MS02
,0 as MS03
,0 as CustomerYN
)
--Finally The query part to fetch the data as per understood from your question.
select
*
from cte
where cte.CustomerYN = -1
AND(
(cte.MS01 = -1 AND 'MS01' = (Select idSite from @idSites where idSite = 'MS01'))
OR (cte.MS02 = -1 AND 'MS02' = (Select idSite from @idSites where idSite = 'MS02'))
OR (cte.MS03 = -1 AND 'MS03' = (Select idSite from @idSites where idSite = 'MS03'))
)
而不是映射到python的python3.4
。
很遗憾,python2.7
忽略了virtualenvwrapper
,并始终使用VIRTUALENVWRAPPER_PYTHON
。
我已经看到了问题here
那里提到的东西都没有帮助我。
我使用python2.7
pip3
而不是[root@server]# pip3 install virtualenv setuptools virtualenvwrapper
Requirement already satisfied: virtualenv in /usr/lib/python3.4/site-packages (16.0.0)
Requirement already satisfied: setuptools in /usr/lib/python3.4/site-packages (40.5.0)
Requirement already satisfied: virtualenvwrapper in /usr/lib/python3.4/site-packages (4.8.2)
Requirement already satisfied: virtualenv-clone in /usr/lib/python3.4/site-packages (from virtualenvwrapper) (0.4.0)
Requirement already satisfied: stevedore in /usr/lib/python3.4/site-packages (from virtualenvwrapper) (1.29.0)
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /usr/lib/python3.4/site-packages (from stevedore->virtualenvwrapper) (5.0.0)
Requirement already satisfied: six>=1.10.0 in /usr/lib/python3.4/site-packages (from stevedore->virtualenvwrapper) (1.11.0)
:
pip
在创建venv之前,我还设置了env变量:
[root@server]# pip uninstall virtualenvwrapper
Skipping virtualenvwrapper as it is not installed.
但是,每当我创建venv时,它都会使用[dakes@server .virtualenvs]$ export |grep -i virtual
declare -x VIRTUALENVWRAPPER_HOOK_DIR="/home/dakes/.virtualenvs"
declare -x VIRTUALENVWRAPPER_PROJECT_FILENAME=".project"
declare -x VIRTUALENVWRAPPER_PYTHON="/usr/bin/python3.4"
declare -x VIRTUALENVWRAPPER_SCRIPT="/usr/bin/virtualenvwrapper.sh"
declare -x VIRTUALENVWRAPPER_VIRTUALENV="/usr/local/bin/virtualenv"
declare -x VIRTUALENVWRAPPER_WORKON_CD="1"
declare -x WORKON_HOME="/home/dakes/.virtualenvs"
,如您在第3行中看到的那样:
python2.7
我在做什么错了?
/编辑:
我能够通过添加来解决
[dakes@server ~]$ mkdir virtualenvtest
[dakes@server ~]$ mkvirtualenv test -a virtualenvtest/
New python executable in /home/dakes/.virtualenvs/test/bin/python2.7
Also creating executable in /home/dakes/.virtualenvs/test/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/dakes/.virtualenvs/test/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/dakes/.virtualenvs/test/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/dakes/.virtualenvs/test/bin/preactivate
virtualenvwrapper.user_scripts creating /home/dakes/.virtualenvs/test/bin/postactivate
virtualenvwrapper.user_scripts creating /home/dakes/.virtualenvs/test/bin/get_env_details
Setting project for test to /home/dakes/virtualenvtest
到我的.bashrc