由于ec2服务器中的EnvironmentError,无法安装软件包

时间:2018-05-31 17:57:07

标签: django linux amazon-ec2 server pip

我在我工作的amazon ec2 linux服务器上输入以下内容。 (已激活ENV)

SELECT  
    p_mv.created_by                            createby, 
    TO_CHAR(sf_get_local(p_con.created_date,p_con.cdate_tz_code),'DD MON YY HH24:MI')  createdate,
    port.port_name                             dest, 
    p_con.pipeline_ref_id                      consolno, 
    reference_numbers.ref_num                  refnum, 
    route_s.vessel_name                        vessel, 
    route_s.flight_voyage                      voyage, 
    TO_CHAR(sf_get_local(route_s.orgn_vsl_arvl_date,route_s.orgn_vsl_arvl_date_tz_code),'DD/MM/YYYY')  destdate, 
    TO_CHAR(sf_get_local(route_s.arrival_date,route_s.arrival_date_tz_code),'DD/MM/YYYY') origindate, 
    TO_CHAR(sf_get_local(route_s.orgn_vsl_arvl_date,route_s.orgn_vsl_arvl_date_tz_code),'DD MON YY HH24:MI')  destdate, 
    TO_CHAR(sf_get_local(route_s.arrival_date,route_s.arrival_date_tz_code),'DD MON YY HH24:MI') origindate, 
    carrier.carrier_name                       carrier, 
    p_mv.pipeline_ref_id                       mawb, 
    sf_get_local(route_s.orgn_vsl_arvl_date,route_s.orgn_vsl_arvl_date_tz_code)  real_origindate ,
    DECODE(p_con.pipeline_tx_status,'O','OPEN','MFT','MANIFESTED','IS','ISSUED','CNF','CONFIRMED','OI','OPEN IMPORT','ICF','CONFIRM IMPORT','C','CLOSED','VD','VOID',p_con.pipeline_tx_status) status,
    cd_code.cd_description               consol_type



    from  pipeline             p_mv, 
    pipeline             p_con, 
    pipeline_relations   pr_cs, 
    route route_s , 
    reference_numbers, 
    carrier, 
    carrier_segment, 
    mwb_header ,
    consol ,
    port ,
    (SELECT cd_code,cd_description FROM  code_detail WHERE cm_code = '436') cd_code 

    where  (p_mv.pipeline_tx_id = pr_cs.pipeline_tx_id) AND 
    (p_mv.pipeline_tx_type = 'CS') AND 
    (pr_cs.rel_pipeline_tx_id = p_con.pipeline_tx_id(+)) AND    
    (pr_cs.rel_pipeline_tx_type(+) = 'CO' )  and 
    (p_con.pipeline_tx_id = consol.pipeline_tx_id) and 
    (p_mv.pipeline_tx_id = mwb_header.pipeline_tx_id(+)) and  
    (p_mv.pipeline_tx_id = reference_numbers.pipeline_tx_id(+)) and   
    (reference_numbers.ref_num_type(+) = 'CN') and  
    (p_mv.pipeline_tx_id = route_s.pipeline_tx_id(+)) and 
    (route_s.route_type(+) = 'S') and 
    (route_s.line_no(+) = 1) and 
    p_mv.pipeline_tx_id = carrier_segment.pipeline_tx_id(+) and 
    carrier_segment.carrier_code = carrier.carrier_code(+) and 
    p_con.port_dest = port.port_code(+) and 
    cd_code.cd_code(+) = consol.consol_service_type
    AND (p_con.orig_company_id ='570')
    AND (p_con.orig_terminal_id ='5705')
    AND p_con.pipeline_tx_status='CNF'
     AND mwb_header.transport_mode='O'

     and
/*Passing dates with the case statement to pass to different date abject at a time*/
    case '&psStatusType'
               when 'CTA' then p_con.created_date
               when 'VAD' then route_s.orgn_vsl_arvl_date
               when 'ETA' then route_s.arrival_date
               else null -- default anyway
          end 
          between to_date('&1','DD-MON-YYYY:HH24:MI:SS')
                  AND to_date('&2','DD-MON-YYYY:HH24:MI:SS')




    UNION
    /*Using UNION functionality to join the query*/






    select
     p_con.created_by                            createby, 
    TO_CHAR(sf_get_local(p_con.created_date,p_con.cdate_tz_code),'DD MON YY HH24:MI')  createdate, 
    port.port_name                             dest, 
    p_con.pipeline_ref_id                      consolno, 
    ''                                         refnum, 
    route_s.vessel_name                        vessel, 
    route_s.flight_voyage                      voyage, 
    TO_CHAR(sf_get_local(route_s.orgn_vsl_arvl_date,route_s.orgn_vsl_arvl_date_tz_code),'DD/MM/YYYY')  destdate, 
    TO_CHAR(sf_get_local(route_s.arrival_date,route_s.arrival_date_tz_code),'DD/MM/YYYY') origindate, 
    TO_CHAR(sf_get_local(route_s.orgn_vsl_arvl_date,route_s.orgn_vsl_arvl_date_tz_code),'DD MON YY HH24:MI') destdate, 
    TO_CHAR(sf_get_local(route_s.arrival_date,route_s.arrival_date_tz_code),'DD MON YY HH24:MI') origindate, 
    carrier.carrier_name                       carrier, 
     ''                                         mawb, 
    sf_get_local(route_s.orgn_vsl_arvl_date,route_s.orgn_vsl_arvl_date_tz_code)  real_origindate ,
    DECODE(p_con.pipeline_tx_status,'O','OPEN','MFT','MANIFESTED','IS','ISSUED','CNF','CONFIRMED','OI','OPEN IMPORT','ICF','CONFIRM IMPORT','C','CLOSED','VD','VOID',p_con.pipeline_tx_status) status,
    cd_code.cd_description               consol_type 


    from pipeline p_con, 
    route route_s , 
    carrier, 
    consol ,
    port, 
    PIPELINE_RELATIONS PREL_CS, 
    (SELECT cd_code,cd_description FROM  code_detail WHERE cm_code = '436') cd_code



    where  (p_con.pipeline_tx_id = consol.pipeline_tx_id) and 
    P_CON.PIPELINE_TX_ID = PREL_CS.PIPELINE_TX_ID AND 
    PREL_CS.REL_PIPELINE_TX_TYPE ='CS' AND 
    (PREL_CS.REL_pipeline_tx_id = route_s.pipeline_tx_id(+)) and 
    (route_s.route_type(+) = 'S') and 
    (route_s.line_no(+) = 1) and 
    route_s.carrier_code = carrier.carrier_code(+) and 
    p_con.port_dest = port.port_code(+) and 
    cd_code.cd_code(+) = consol.consol_service_type and
    p_con.orig_company_id='570' and
    p_con.orig_terminal_id='5705'  and
    p_con.pipeline_tx_status='CNF' and
    consol.transport_mode = 'O'
     and

/*Passing dates with the case statement to pass to different date abject at a time*/
    case '&psStatusType'
               when 'CTA' then p_con.created_date
               when 'VAD' then route_s.orgn_vsl_arvl_date
               when 'ETA' then route_s.arrival_date
               else null -- default anyway
          end 
          between to_date('&1','DD-MON-YYYY:HH24:MI:SS')
                  AND to_date('&2','DD-MON-YYYY:HH24:MI:SS')

收到此错误:

pip install pillow

如果我使用--user我得到:     无法执行' - 用户'安装。用户站点包在此virtualenv中不可见。

1 个答案:

答案 0 :(得分:5)

根据您的回答,发生的事情是您在创建virtualenv时使用了sudo,因此root拥有它。

sudo chown ec2-user:ec2-user -R ~ec2-user/env将修复此问题,并再次使ec2-user成为目录(和子目录)的所有者。